Two Japanese ministers paid respects Monday at a controversial war shrine seen by neighbouring countries as a symbol of past militarism, as the nation commemorates the end of World War II.

Yasukuni Shrine in Tokyo honours 2.5 million war dead, mostly Japanese, who perished since the late 19th century -- but it also enshrines senior military and political figures convicted of war crimes by an international tribunal after World War II.

Visits to the shrine by government officials have long angered countries that suffered at the hands of the Japanese military before and during the war, particularly South Korea and China.

Sanae Takaichi, the hawkish minister for economic security, and Kenya Akiba, minister for reconstruction in the disaster-hit northern Tohoku region, offered their respects at the shrine.

Takaichi is a regular visitor to Yasukuni and was close to former prime minister Shinzo Abe, whose assassination last month shocked the world.

"This year, there is war in Ukraine. I prayed that no more people will die in wars," Takaichi told reporters, saying that she had offered her "gratitude" to the war dead enshrined there.

Trade minister Yasutoshi Nishimura also visited the shrine at the weekend.

But Prime Minister Fumio Kishida, who took office in October, opted to make a traditional cash offering instead on Monday.

A Japanese prime minister has not appeared at the shrine since 2013, when Abe sparked fury in Beijing and Seoul and earned a rare diplomatic rebuke from close ally the United States.

Kishida's office told AFP he gave the offering at his personal expense and "through a proxy, in the capacity of president of the Liberal Democratic Party".

In recent months, Kishida has urged warmer ties with South Korea, saying the two countries "can't afford to waste time" in improving relations, following years of tensions over wartime issues.

Also on Monday, Emperor Naruhito and Empress Masako attended a national ceremony to mark the 77th anniversary of Japan's surrender and the end of World War II.