Canadian Prime Minister Justin Trudeau.

Canadian Prime Minister Justin Trudeau on Wednesday apologized for the government's failure in 1939 to admit a ship carrying 907 German Jews fleeing Nazi persecution.

"Today I rise to issue a long-overdue apology to the Jewish refugees Canada turned away," Trudeau said in a speech to Parliament.

He apologized to the Jews on the ship, which was forced to return to Europe, where many of the Jews later were killed in the Holocaust.

"While decades have passed since we turned our backs on Jewish refugees, time has by no means absolved Canada of its guilt or lessened the weight or our shame," Trudeau said.

He cited the October 27 shooting at a synagogue in Pittsburgh, Pennsylvania that killed 11 Jews during a religious service as a "tragic reminder" that anti-Semitism still exists in Canada and elsewhere in the world.

Trudeau called on all Canadians to stand up against those "xenophobic and anti-Semitic attitudes."

Before the apology, Trudeau met with a woman who was a passenger on the ship that was turned away and who now lives in Canada. He also noted the 80th anniversary on Friday of the Kristallnacht, a night of violence in Germany against Jewish homes and businesses.

The apology comes amid controversy over migrants who are fleeing violence and lack of economic opportunity in their home countries in South America.

US President Donald Trump has referred to multiple caravans of people moving toward the US-Mexico border as an "invasion" and warned the people not to continue their march. Democrats accused the president of fear-mongering to appeal to voters ahead of Tuesday's midterm election.