OTTAWA - Prime Minister Justin Trudeau is formally apologizing in the House of Commons for a 1914 government decision that barred most of the passengers of the Komagata Maru from entering Canada.

The chartered vessel was carrying 376 Indian passengers, nearly all of them Sikhs, bound for what they thought would be a new life in Canada.

They were hoping to challenge the immigration laws at the time which refused entry to any Indians who had not arrived in Canada via a continuous journey from the home country _ nearly impossible at the time.

Canadian officials refused to allow the Indians in, even though they were British subjects just like every other Canadian of the time.

After 20 passengers who had previously lived in Canada were allowed to disembark, the ship was turned away.

It returned to India, where 19 of the passengers were killed in a skirmish with British authorities and dozens of others were imprisoned or forced into hiding.

``Mr. Speaker, today I rise in this House to offer an apology on behalf of the government of Canada, for our role in the Komagata Maru incident,'' Trudeau said.

``Canada cannot solely be blamed for every tragic mistake that occurred with the Komagata Maru and its passengers.

``But Canada's government was, without question, responsible for the laws that prevented these passengers from immigrating peacefully and securely. For that, and for every regrettable consequence that followed, we are sorry.''

Trudeau's formal apology is the second from a Canadian prime minister. Former prime minister Stephen Harper delivered an apology in 2008 in British Columbia, not the House of Commons.

Some Indian Canadians saw Harper's move as a slight.

Trudeau promised the Commons apology during the last election campaign.

The B.C. legislature passed its own resolution apologizing in May 2008.