Former Taiwan President Lee Teng-hui on Sunday attended a memorial service in Okinawa for Taiwanese soldiers killed there fighting for Japan.

Lee, 95, is in Okinawa, Japan's southernmost prefecture, on a four-day visit from Friday to pay tribute to Taiwanese killed in the 1945 battle on the island. Taiwan was under Japanese colonial rule for a half century until 1945.

Lee attended a plaque-unveiling ceremony for a monument in honor of the Taiwanese who died in the bloody battle. The event took place at the Peace Memorial Park, located in the Mabuni Hill area of Itoman city.

Mabuni Hill was the final command post of the Japanese army in Okinawa and the place where the 1945 battle came to a bitter end.

Lee, Taiwan's first popularly elected leader, said the message he wrote on the plaque is meant to convey the lesson taught to future generations. Engraved on the monument are the Chinese characters that mean to be committed to the public good.

The memorial service has been held since 2013.

June 23 is Okinawa Memorial Day, when the island stops to remember the lives lost in the Battle of Okinawa.

Lee is on his ninth visit to Japan since stepping down from the presidency in 2000. His last visit was in July 2016, when he traveled to the southern island of Ishigaki.

Growing up under Japanese rule in Taiwan, Lee developed an affinity for Japan even before he went to study at Kyoto Imperial University, now known as Kyoto University.