Japan's prime minister has made another pilgrimage to a Shinto shrine that other Asian nations say glorifies Japanese militarism. The visit has sparked angry responses from China and South Korea.

Prime Minister Junichiro Koizumi spent less than five minutes at Yasukuni Shrine, appearing to toss some coins into a collection box, before silently praying and bowing his head. He did not speak with reporters.

Foreign Ministry spokesman Akira Chiba says that Mr. Koizumi, despite traveling in a government motorcade accompanied by his security detail, was not making an official visit.

"As the government understands it, it is a private visit made by Mr. Koizumi this morning," he said. "The prime minister's position requires that he is guarded around the clock and that transportation is provided even though he goes to a bookstore."

Japan's neighbors accuse Mr. Koizumi of trampling on unhealed wounds from Japan's 20th century legacy of brutal imperialism and war. On Monday, both Chinese and South Korean officials quickly and strongly protested the visit to the Shinto war shrine.

The souls of nearly 2.5 million people who sacrificed their lives on behalf of Japan during the Second World War - including a number of convicted war criminals - are enshrined at Yasukuni.

This was Mr. Koizumi's fifth visit to the shrine since he became prime minister in April 2001. He has made good on his pledge to go to the controversial Shinto site once a year.

Every major Japanese television network interrupted normal programming to show Mr. Koizumi, who is enjoying strong popularity in opinion polls, visiting Yasukuni. The visits, however, are controversial at home, with the public nearly evenly split on whether Mr. Koizumi should make them.

Tokyo University Professor Emeritus Shinkichi Eto says Mr. Koizumi, whose cousin was a kamikaze pilot who died during World War II, is among those trying to create a new Japanese nationalism and seems to care little about the potential international backlash.

"I don't know if Mr. Koizumi himself and his subordinates understand the feelings of Korean and Chinese people, particularly the old people who were really victimized by the Japanese occupation," said Mr. Eto. "This is my feeling but their sentiment is irrelevant to Koizumi."

The Osaka High Court last month ruled that Mr. Koizumi's visits to the shrine violate the constitution. But a number of other courts addressing the same issue have not ruled on the constitutionality question.

Monday's visit to Yasukuni by Mr. Koizumi comes at a low point in Japan's relationships with China and South Korea. Tokyo has unsettled territorial disputes with both countries.

The Japanese Embassy in Beijing has warned Japanese nationals in China to take precautions, as there might be strong reactions there to Mr. Koizumi's visit to the shrine. Earlier in the year there were anti-Japanese riots in China after Tokyo approved new school texts that many say glosses over Japan's militaristic past.