German Chancellor Angela Merkel has begun a two-day visit to Japan by discussing Germany's reconciliation efforts after World War Two.
She said Germany had "faced its past squarely", helping it move forward.
Japan has been criticised by its neighbours for what is seen as its inadequate acknowledgement and education of wartime atrocities.
PM Shinzo Abe is due to give a statement later this year to mark the 70th anniversary of the end of the war.
But there is speculation he may water down Japan's past apologies for its aggression in Asia.
Ms Merkel and Mr Abe are expected to use her visit to discuss a free trade agreement, the crisis in Ukraine, and anti-terrorism efforts.
During her lecture - at the headquarters of the Asahi Shimbun newspaper in Tokyo on Monday - Ms Merkel noted that Germany's acceptance into the international community following World War Two was possible because Germany had dealt with its past.
"There was the acceptance in Germany to call things by their name," she said.
What also helped were "generous gestures by our neighbours" in re-accepting Germany, she said. France had made "just as valuable a contribution as the Germans have" to reconciliation, she added.
She said she could not give specific advice on how Japan should deal with the past, but that "history and experience tells us also that peaceful means of reconciliation have to be found".
Her remarks come a month after Japan's Crown Prince Naruhito urged the country to "look back humbly on the past".
PM Shinzo Abe, who is known for his hawkish views, has appointed a panel to advise him on a statement he plans to make in August on the 70th anniversary of the end of World War Two.
The issue of forgiveness has been for decades the source of diplomatic tension between Japan and its wartime victims, notably China and South Korea.
This tension has ramped up in recent years, particularly since Mr Abe took office in 2012.
China and South Korea have denounced visits made by Mr Abe and other senior ministers to Yasukuni Shrine which commemorates Japan's war dead including war criminals.
An attempt by his government to review Japan's landmark 1993 apology for forcing Asian women to be sex slaves also drew intense criticism, and was shelved last year.
Japanese school history textbooks have long been accused of whitewashing Japan's wartime atrocities.
The issue has also been aggravated by Japan's move towards militarisation, which Mr Abe has defended as a right to collective self-defence, and territorial claims.