China summoned Tokyo's ambassador Thursday and delivered a "strong protest and severe reprimand" over Japanese Prime Minister Shinzo Abe's visit to the flashpoint Yasukuni shrine, the foreign ministry said.
Foreign Minister Wang Yi said the move -- the first such visit by an incumbent Japanese prime minister since 2006 -- was "a flagrant provocation against international justice and treads arbitrarily on humanity's conscience", according to a ministry statement on its website.
Sino-Japanese relations were "already grim", it said, adding: "It's absolutely intolerable for the Chinese side."
Tensions between the two were already high over disputed islands in the East China Sea.
The Japanese embassy in Beijing said a meeting between Chinese Vice Premier Liu Yandong and visiting Japanese lawmakers had been cancelled.
Yasukuni is believed to be the repository of around 2.5 million souls of Japan's war dead, most of them common soldiers but also including 14 high-level officials indicted for war crimes after World War II.
"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 in a statement immediately after Abe's action.
Abe was "brutally trampling on the feelings of the Chinese people and those of other victimised Asian countries", he added.
China's ruling Communist Party seeks to bolster its public support by tapping into deep-seated resentment of Japan for its brutal invasion of the country in the 1930s.
Before and during World War II Japanese forces swept through much of east Asia, and their treatment of both civilians and prisoners of war was often appalling.
According to estimates by Chinese government researchers, China lost 20.6 million people directly from the war.
The 1937 Nanjing Massacre was one of the worst atrocities. Qin told reporters at a regular briefing that if Abe genuinely wanted to improve relations between Tokyo and its neighbours, "he should go to the memorial for the Nanjing Massacre rather than to Yasukuni shrine".
Even now the two countries' history is a key element of the backdrop to their bitter dispute over islands in the East China Sea, which Beijing sees as having been seized by Tokyo at the start of its expansionism.
The world's second- and third-biggest economies have significant business ties, but politically their relationship is often troubled. At times tensions over the islands have raised fears of a military incident.
Taiwan, which Japan colonised from 1895 to 1945, urged Tokyo to "face the facts and remember the lessons from history to refrain from taking any moves to hurt the people's feelings in neighbouring countries", according to a foreign ministry statement.
In a commentary soon after Abe's shrine visit, Xinhua said he "knows perfectly what he is doing and the consequences".
"Instead of a pledge against war, as Abe has claimed, the visit is a calculated provocation to stoke further tension," it said, adding that the visit "is the culmination of Abe's year-long policy of right-wing nationalism".
Users of China's popular social networks responded with fury, with many noting that Abe made his move on the same day that Chinese President Xi Jinping was paying tribute to Mao Zedong on the 120th anniversary of the former leader's birth.
"The base of Abe's power comes from his confrontation with China, so whatever upsets China, that's what he'll do," said one post.
"No matter what he says about China-Japan friendship, Asian prosperity and joint promotion of peace, it's all a facade."