Andrzej Duda was speaking as he attended memorial ceremonies to mark 80 years since the Soviet Union invaded Poland in the early days of World War II.
At dawn on September 17, 1939, Soviet troops invaded Poland following a secret agreement with the German Third Reich.
Poland was then caught between German Nazi forces advancing from the west and Soviet forces from the east.
Following the invasion, some 250,000 Polish soldiers were captured by the Soviets, who later executed thousands of prisoners of war, public broadcaster Polish Radio’s IAR news agency has reported.
Mass deportations of the civilian population followed, with up to 1.5 million Poles transported away into the Soviet interior, mainly to Siberia and Kazakhstan, according to some estimates.
'Torn apart by two totalitarian powers'
Speaking during a wreath-laying ceremony in Warsaw, Duda said that Poland was in the opening phase of World War II "torn apart by two totalitarian powers," Nazi Germany and Soviet Russia.
He added that “hundreds of thousands, millions of Poles suffered, were murdered, and taken by the Soviets deep into Russia’s Siberia."
Duda noted that one consequence of the Soviet wartime aggression was the Katyn massacre of over 20,000 Polish officers.
He added that, after being attacked by the Soviet Union on September 17, 1939, Poland did not regain full freedom until “the last Soviet soldier left" the country in 1993.
Duda also said that tragic dates from history must be remembered and that “lessons should learned from them, while looking for allies.”
"I trust we have such allies today,” he said. “We are a member of the North Atlantic Alliance, we are part of the European Union, and I believe that what happened in September 1939 will never happen again in our history, that we will build a secure, strong state which will be able to protect its citizens.”
'One of the most tragic dates in recent Polish history'
Officials were later in the day due to attend ceremonies at sites including Warsaw's Monument to the Fallen and Murdered in the East and the city's central Piłsudski Square, where a special Independence Concert was scheduled to be held in the evening.
On the eve of the anniversary, Defence Minister Mariusz Błaszczak said in a Twitter post that September 17, 1939 was one of the most tragic dates in recent Polish history.
Tens of thousands of ethnic Poles killed in the former USSR before the 1939 Soviet invasion were remembered at memorial ceremonies in Warsaw last month.