The incident occurred while more than 100 people were gathered at the shrine for a harvest ritual, marking Japan's Labour Thanksgiving public holiday, but it did not interrupt their celebrations.
Passengers evacuated from Shaheen Air flight following bomb scare
The Yaksukuni Shrine is regarded as a symbol of Japan's past militarism and visits to the shrine by Japanese politicians have stoked protests from China and South Korea, where memories of Japanese occupation and colonialism before and during World War Two run deep.
The authorities have not said what caused the blast, but police are investigating for any possible link to extremists, Japanese media reported.
The blast left a 30-centimetre (12 inch) hole in the ceiling of the mens washroom, public broadcaster NHK reported. Investigators found batteries and wire, raising suspicions that they could have been part of a detonator device, media said.
Police received the call at 10am (0100 GMT) from a person who heard the explosion and saw smoke inside the washroom near the main gate to the shrine, a police official told Reuters.
Bombings near Iraq Shia mosque kill six: officials
The official did not give further details.
A Reuters photographer saw members of a police bomb disposal unit, wearing protective body armour, close to the washroom as investigations were carried out.
In January 2013, a South Korean court ruled that a Chinese citizen who carried out an arson attack on the shrine could not be extradited to Japan as he had committed a "political crime" and might not get a fair trial.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ