Nationalist Prime Minister Shinzo Abe paid an inflammatory visit to the controversial Yasukuni war shrine on Thursday, a move Beijing immediately condemned as glorification of Japan's past "militaristic aggression", warning Tokyo must "bear the consequences".
Abe described his visit, which comes days after he caused consternation by giving Japan's military its second consecutive annual budget bump, as a pledge against war and said it was not aimed at hurting feelings in China or South Korea.
Yasukuni Shrine is the believed repository of around 2.5 million souls of Japan's war dead, most of them common soldiers, but also including several high-level officials executed for war crimes after World War II, who were enshrined in the 1970s.
South Korea and China see it as a symbol of Tokyo's unrepentance for the horrors of last century and say it whitewashes the country's warmongering past.
"Some people criticise the visit to Yasukuni as paying homage to war criminals, but the purpose of my visit today... is to report before the souls of the war dead how my administration has worked for one year and to renew the pledge that Japan must never wage a war again," Abe said in a statement released after the visit.
"For 68 years after the war, Japan created a free and democratic country, and consistently walked the path of peace. There is no doubt whatsoever that we will continue to pursue this path.
"It is not my intention at all to hurt the feelings of the Chinese and Korean people. It is my wish to respect each other's character, protect freedom and democracy, and build friendship with China and Korea with respect."
The visit came exactly 12 months after he took power, a period in which he has met neither China's President Xi Jinping or Korea's President Park Geun-Hye.
Ties with Beijing were bad before Abe took office, with the two countries crossing diplomatic swords over the ownership of a string of uninhabited islands in the East China Sea, controlled by Japan, but claimed by China.
The dispute has been ratcheted up further this year, with the involvement of military aircraft and ships, leaving some observers warning of the danger of armed conflict between the world's second- and third-largest economies.
Beijing wasted no time in slamming Abe's move, which came the day Xi and other senior Chinese leaders visited the mausoleum of Mao Zedong, the hardline communist who led China through the Cultural Revolution when upwards of two million people were killed.
"The essence of Japanese leaders' visits to the Yasukuni shrine is to beautify Japan's history of militaristic aggression and colonial rule," foreign ministry spokesman Qin Gang said.
Qin's statement came after a Chinese foreign ministry official condemned Abe's visit as "absolutely unacceptable to the Chinese people".
Japan "must bear the consequences arising from this", Luo Zhaohui, director-general of the ministry's department of Asian affairs, said in a statement posted on a verified ministry microblog.
The last incumbent Japanese prime minister to visit the shrine was Junichiro Koizumi on August 15, 2006, the anniversary of Japan's defeat in 1945.
His repeated pilgrimages badly soured relations with China, despite the important economic and trade ties that bind the two countries.
The foreign ministry in Tokyo said it wanted to stress Abe "visited Yasukuni Shrine in a purely personal capacity (and)... not... to pay homage to war criminals".
However, China and South Korea, both victims of Japan's 20th century aggression, say no such distinction exists.
Abe did not visit the shrine during his first term as prime minister from 2006 to 2007, although later said that he felt "extremely remorseful" for that.
Abe's forthright views on history -- he has previously questioned the definition of "invade" in relation to Japan's military adventurism last century -- have raised fears over the direction he wants to take the officially-pacifist country.
He has spoken repeatedly of his desire to tweak the US-imposed constitution, which limits the functions of the military, and has been on a drive in recent weeks to broaden the definition of their role to allow for "collective self-defence", which would allow Japanese troops to come to the aid of allies.
Takehiko Yamamoto, a professor of international relations at Tokyo's Waseda University, said the visit was "an act of folly" that was certain to make a bad situation worse.
"It is perfectly possible his visit will fuel worries in Washington over a possible rise of militarism and a shift to the right in Japan," he said.