Prime Minister Shinzo Abe made a surprise visit to the war-related Yasukuni Shrine in Tokyo on Thursday, the first anniversary of his second stint as prime minister.

The visit worsens the odds of a summit with leaders of China and South Korea, countries that regard Yasukuni as a symbol of Japan’s wartime militarism. The visit also coincided with the late Chinese Chairman Mao Zedong’s 120 birthday.

Abe arrived at the shrine around 11:30 a.m. to pay his respects to the millions of war dead enshrined there. Class-A war criminals, most notably wartime Prime Minister Gen. Hideki Tojo, are also among those enshrined.

Inside the main building he bowed in a Shinto ceremony and made a donation out of his own pocket.

Abe is the first prime minister to visit Yasukuni since Junichiro Koizumi in 2006.

Facing reporters at the shrine, Abe repeatedly stressed that he was not there “to pay homage to war criminals,” as many have claimed, but rather to pray for peace.

“Some people criticize a visit to Yasukuni as something to pay homage to war criminals, an idea based on misunderstanding,” Abe said.

“I paid a visit to show (to the war dead) my determination to create an age where no one will ever suffer from tragedies of wars,” he added.

Yasukuni enshrines millions of Japanese soldiers who died for the state in modern wars. During the 1930s and ’40s, it served as a spiritual pillar for members of the military and their families. But it also enshrines 12 convicted Class-A war criminals and another two suspects who died in prison before their rulings were handed down at the postwar International Military Tribunal for the Far East, or Tokyo Tribunal.

Abe’s visit immediately drew harsh reactions from China and South Korea.

Chinese Ambassador to Japan Cheng Yonghua lodged a protest at the Foreign Ministry. Yonhap news agency quoted a South Korean government official as saying Abe’s visit will draw “huge diplomatic repercussions” from Seoul.

Experts warned Abe’s visit is likely to give more momentum to anti-Japan hard-liners in the leadership of China and South Korea.

The two countries will now find it more difficult to strike any political compromises with Japan over territorial disputes, most prominently the Senkaku islets in the East China Sea, they said.

“Hard-liners are always looking for some reason (to urge top leaders) to be tougher against Japan. Now you can say Japan is no doubt leaning toward the right,” said Bonji Ohara, a research fellow at Tokyo Foundation.

Until this fall, Abe had offered to hold summits with his Chinese and South Korean counterparts, repeating that his door for dialogue was always open. Beijing and Seoul weren’t interested.

With little chance for a summit with China and South Korea anytime soon, “probably Abe could not wait any more,” Ohara said.

Tsuneo Watanabe, a senior fellow at the Tokyo Foundation, warned that Abe’s visit will also damage his reputation among political leaders in the United States and Europe and adversely affect Japan’s diplomacy as a whole.

“This will damage the national interests of Japan,” he said.

Abe appeared to be well aware of the political and diplomatic risks he was running. Facing reporters, a grim-faced Abe repeatedly stressed he had come to the shrine to pay his respects to the war dead, without political overtones.

“It is not my intention at all to hurt the feelings of the Chinese and Korean people,” Abe said.

But when asked to comment on the responsibilities borne by the enshrined wartime leaders, Abe offered no direct response.

“Based on our soul-searching over the past, we have protected basic human rights and built up the democracy and freedom of Japan after the war,” Abe said.

A conservative nationalist, Abe has dedicated most of his political energies to economic issues since his inauguration last December.

His relatively soft approach to China and South Korea has earned the ire of core nationalist supporters, who may now be appeased by the shrine visit.

During the campaign for the presidency of the Liberal Democratic Party in the fall of last year, Abe said, “it was extremely regrettable” that he could not go to Yasukuni during his first prime ministership from 2006 to 2007.

At a news conference later Thursday, Chief Cabinet Secretary Yoshihide Suga insisted Abe visited the shrine in a private capacity and should be allowed to enjoy freedom of religion.