Image copyright AP Image caption Mr Abe sent his message to the Koyasan Okuno-in temple, which has a compound honouring war criminals

Japanese PM Shinzo Abe sent a message to a ceremony honouring war criminals, officials have confirmed, amid strained ties with China and South Korea.

In the message, sent in April, he paid tribute to soldiers who gave their lives for "the foundation of the fatherland", reports said.

A government spokesman said the message had been sent in a private capacity.

Mr Abe is under fire from China and South Korea for his perceived attitude to Japan's war-time history.

Local reports said that Mr Abe had sent his message to the Buddhist Koyasan Okuno-in temple in Wakayama in western Japan.

It houses a monument to more than 1,000 "Showa martyrs," referring to soldiers who fought in World War Two in the name of the late Emperor Hirohito.

The monument also honours the 14 "Class A" war criminals who were military leaders, also commemorated at the more well-known Yasukuni shrine in Tokyo.

Mr Abe reportedly said: "I offer my sincere condolences to the spirits of those Showa martyrs who gave their lives for the sake of today's peace and prosperity, becoming the foundation of the fatherland."

"I pray for eternal peace and pledge to carve out a path to a future of human coexistence."

Image copyright AFP Image caption Several Japanese lawmakers and ministers visited the Yasukuni war shrine on 15 August

Mr Abe has previously said that those convicted by the tribunal set up by Allied forces after the war are not considered war criminals under Japanese law.

The prime minister, who was elected in December 2012, angered China and South Korea when he visited Yasukuni a year later.

He sent traditional offerings to the shrine both in April and earlier this month during visits by lawmakers and ministers.

China and South Korea view the shrine as a symbol of Japan's past militarism and are always angered by visits.

South Korea is still at odds with Japan over sex slaves - women forced into war-time prostitution for the Japanese military - following the suggestion, now shelved, by Mr Abe's government that Japan could review a landmark 1993 apology on the issue.

Meanwhile China and Japan remain locked in a bitter dispute over the ownership of a string of islands in the East China Sea known as Senkaku in Japan and Diaoyu in China.