Image copyright Reuters Image caption Mr Trudeau delivered a formal apology for the 1914 incident

Calling it a "stain on Canada's past", Prime Minister Justin Trudeau has apologised for turning away of a ship of Sikhs, Hindus and Muslims in 1914.

A Japanese steamship, the Komagata Maru, arrived in Canada on 23 May 1914 from Hong Kong, carrying 376 migrants.

Most passengers were turned away and the ship sat in the harbour for two months before returning to India.

Twenty passengers were killed and many were jailed after a riot broke out upon the ship's return.

They were denied entry into Canada because of the laws of that time.

"Today - while knowing that no words can fully erase the pain and suffering experienced by the passengers - I offer a sincere apology on behalf of the government for the laws in force at the time that allowed Canada to be indifferent to the plight of the passengers of the Komagata Maru," Mr Trudeau said in the House of Commons on Wednesday.

Image copyright Twitter

"We have learned, and will continue to learn, from the mistakes of our past. We must make sure to never repeat them."

Opposition leader Rona Ambrose echoed Mr Trudeau's statements and highlighted some of the efforts of Canada's South Asian community in helping out victims of the Fort McMurray wildfire.

New Democratic Party leader Tom Mulcair said the incident occurred purely because of "racism".

"It was racism, pure and simple, that put our fellow humans at risk," he said.

The ship was chartered by a Sikh businessman who believed India, then a British colony, should be able to visit other countries in the Commonwealth. At the time, Canada's immigration rules were becoming strict, the CBC notes.

It is not the first time a Canadian leader has apologised for a past wrongdoing.

Stephen Harper apologised to former students of Catholic residential schools for their abuse in 2008 and Brian Mulroney apologised to Japanese Canadians for internment during the Second World War in 1988.