The German president vowed his country would never forget the atrocities of the Nazi period on Sunday as he asked forgiveness from Poland during a series of commemorative events to mark the 80th anniversary of the outbreak of the second world war.

“In no other square in Europe do I find it more difficult to speak, and to address you in my native language of German ... I ask for forgiveness for Germany’s historical guilt and I recognise our enduring responsibility,” Frank-Walter Steinmeier said at a ceremony in Piłsudski Square in Warsaw.

Steinmeier and the German chancellor, Angela Merkel, joined a number of heads of state at the ceremony. Other events were held in Wieluń, which was heavily bombarded by the German air force on the first day of the war; and Westerplatte, where the first shots of the war were fired when a German battleship opened fire on a Polish garrison in the early hours of 1 September.

“It is hard to imagine that cataclysm of history today, the armed conflict which brought the most disastrous consequences in the history of mankind. We have to remember, and therefore we are gathered here today,” the Polish president, Andrzej Duda, said at the Warsaw ceremony.

Poland’s nationalist government had hoped that the US president, Donald Trump, would be the guest of honour, but he cancelled at the last minute and sent his vice-president, Mike Pence, in his place.

Despite the atmosphere of reconciliation, different politicians drew very different conclusions about the lessons of the war.

There was a note of anger in Duda’s speech, as he said Europe should have stood up to the Nazis earlier. “Perhaps the second world war would not have broken out in the first place, if the states in the west had put up a decisive resistance against … the imperial ambitions of Hitler,” he said.

By way of comparison, Duda also criticised western leaders who propose rapprochement with the Russian president, Vladimir Putin, after Moscow’s actions in Georgia in 2008 and Ukraine in 2014. “Turning a blind eye is not the recipe for preserving peace. It is a simple way to give consent to further attacks,” he said.

Putin was present at a similar commemoration 10 years ago, but was not invited this year because of the annexation of Crimea in 2014 and Russia’s new revisionist historical policy, which downplays the Nazi-Soviet pact agreed a week before Germany attacked Poland.

The Soviet Union, in accordance with a secret protocol of the pact, invaded Poland from the east on 17 September. Putin called the pact a mistake a decade ago, but Russia’s foreign ministry has embarked on a campaign in recent weeks to show it as necessary and even a diplomatic triumph.

Pence used his speech to talk as much about Soviet atrocities as Nazi crimes, paying tribute to Polish bravery and quoting the Russian writer Alexander Solzhenitsyn. The main problem of the 20th century was that men had forgotten God, he said.

The European commission vice-president, Frans Timmermans, attended the ceremony in Westerplatte and had a different message. He said the best way to honour the memory of the war dead was by “working for tolerance, working for mutual respect, working to remove the feeding ground of those who propose intolerance”. Timmermans has been a vocal critic of the current Polish government.

The Polish prime minister, Mateusz Morawiecki, raised another thorny issue, using his speech at Westerplatte to demand Germany pay reparations for the devastation of Poland during the war.

“We have to talk about, remember and demand the truth regarding those losses. We have to demand compensation,” he said. German officials have insisted that the matter is closed and they will not pay reparations.