China's Foreign Ministry on Monday accused Japan's prime minister of hypocrisy and said he would not be welcome in China after he visited a shrine honoring Japan's war dead.

Ministry spokesman Qin Gang said that Japanese Prime Minister Shinzo Abe's visit to the Yasukuni shrine in central Tokyo had seriously hurt relations between the countries and shut the door for dialogue between their leaders.

"Abe's hypocrisy in his claims of prioritizing relations with China and hopes for dialogue with the Chinese leaders has been fully revealed," Qin said at a regular briefing.

"The Chinese people do not welcome him. Now, Abe needs to admit his mistakes to the government and people of China, cut loose from the past and make a new start," he said.

Japanese politicians' visits to Yasukuni have long caused friction with China and both Koreas, because the 2.5 million war dead enshrined there include 14 class A war criminals from World War II -- national leaders who were either executed or died in prison or during their trials. Japan colonized Korea and occupied parts of China, often brutally, before and during World War II.

It was the first visit to the Shinto-style war shrine by a sitting Japanese prime minister since Junichiro Koizumi went in 2006 to mark the anniversary of the end of World War II. Abe, a nationalist who advocates revising Japan's pacifist constitution, had previously visited Yasukuni while out of office.

South Korean President Park Geun-hye on Monday also urged Japan not to impair bilateral ties by opening up past colonial wounds.

"I hope that there won't be any act of breaking down country-to-country relations ... by digging up the wounds of the past," Park said during a regular meeting with her aides, according to South Korean media pool reports posted on the website of her office.

Park didn't cite Japan by name but Park's office said she was referring to Japan.

Also Monday, North Korea's state media said that Abe's shrine visit was tantamount to a "declaration of war" against people in Asia and the rest of the world.

"Japan has now turned into a war state deviating to the right and fascism," the official Korean Central News Agency said in a commentary.

Abe has previously said criticism that visits to Yasukuni are an act of worshipping war criminals is based on a misunderstanding. He said he did not intend to hurt the Chinese and Korean people's feelings and expressed conviction that Japan must never wage war again.