TORONTO -- Canada will formally apologize for turning away a boat full of Jewish refugees fleeing Nazi Germany in 1939, resulting in scores of them dying, Prime Minister Justin Trudeau said Tuesday.

In a well-received speech to a sold-out Jewish fundraising event, Trudeau said the decision by Canada to force the German ocean liner "MS St. Louis" to return to Europe was a blight on our collective past.

"An apology in the House of Commons will not rewrite this shameful chapter of our history," Trudeau said. "It will not bring back those who perished or repair the lives shattered by tragedy. But it is our hope that this long overdue apology will bring awareness to our failings, as we vow to never let history repeat itself."

In the run-up to the Second World War and the ensuing Holocaust, the Canadian government heeded anti-Semitic sentiment by severely restricting Jewish immigration. From 1933 to 1945, only about 5,000 Jewish refugees were accepted due to what Trudeau called "our discriminatory 'none is too many' immigration policy" in place at the time.

He called the turning away of the ship a "most egregious" example of the misguided policy.

The "St. Louis" was carrying 907 German Jews fleeing Nazi persecution. Its captain, Gustav Schroder, tried in vain to find homes for his passengers. In addition to Cuba, the United States also turned away the refugees.

Forced to return to Europe, 254 of those aboard eventually died in the slaughter that became the Holocaust.

"We cannot turn away from this uncomfortable truth, and Canada's part in it," Trudeau said. "We must learn from this story, and let its lessons guide our actions going forward."

The March of the Living program has seen thousands of Holocaust survivors and others travel to Poland to honour the memory of the six million Jews murdered by the Nazis in concentration camps.

Trudeau spoke eloquently of his own pilgrimage to Auschwitz, the infamous concentration camp in Nazi-occupied Poland.

"We stared at the barbed wire fences that once separated the enslaved from their captors. We marched along the railways that delivered so many Jews to their deaths," Trudeau said.

"My visit to Auschwitz will forever stay with me and guide my time -- as prime minister, but also as a father, husband, son, brother and citizen."

In a statement, the Friends of Simon Wiesenthal Centre applauded Trudeau's announcement as a "meaningful step" toward acknowledging the shameful chapter.

"While an apology can never change the past, it can awaken the national conscience to ensure such grave mistakes are never repeated in the future," centre president Avi Benlolo said.

Trudeau also said recent figures indicate 17 per cent of all hate crimes in Canada target Jewish people. He said it pained him that Jews "more than any other religious group" are the victims of hate crimes.

"We need to do more, as a society, to end xenophobic and anti-Semitic attitudes that still take root in our communities, in our schools, and in our places of work," the prime minister said.

Trudeau said he looked forward to offering the apology himself on the floor of the House of Commons, but he gave no date. The audience applauded loudly at the announcement.

Tuesday was the first official recognition of May as Jewish Heritage Month, a designation passed by the Commons earlier this year.

The fundraiser raised more than $1.1 million.