New York (Agencies): A Somali pirate was sentenced to over 33 years in prison in the US for his involvement in the hijacking of a US-flagged ship off the coast of Africa in 2009.

Abdiwali Abdiqadir Muse, 21, who had pleaded guilty to charges of hostage taking, kidnapping and conspiracy, received a maximum sentence of 405-months yesterday from Manhattan federal Judge Loretta Preska.

Muse along with three other pirates attacked the Maersk Alabama merchant ship off Somalia's coast in April 2009.

Three of other pirates were killed during a rescue mission by the US Navy.

Last year, it was the first piracy case to hit the docks of US courts in decades.

Muse had told the court that he was sorry for his action.

"What we did was wrong," Muse, speaking through an interpreter, told Judge Preska, at that time.

"I am very, very sorry for the harm we did. The reason for this is the problems in Somalia."

"As part of that plan, in April 2009, I boarded the Maersk Alabama with three other men when the ship was about 250 miles off the coast of Somalia. With the use of guns, we took control of the ship and seized the captain and the men on the boat," Muse had said.

On Wednesday, the judge tearfully read aloud from letters written by crew members of the Maersk Alamaba and their family members, The New York Post reported.

"It affects us in our daily lives, and it is not a Disneyland-esque problem," wrote Capt Richard Phillips, who was held hostage for four days on a lifeboat.

"These are not Johnny Depps."

The New York Times last year had reported that in exchange for his guilty plea, prosecutors agreed to drop four of the six counts against him.

Under the plea deal, the pirate faced somewhere between 27 to 33 years in prison.

The judge, however, did not show any leniency and Muse has received more than 33 years.

"I ask for forgiveness from all the people that I harmed, and also the US government," he said on Wednesday.

A lot of uncertainty surrounds the prosecution of pirates in foreign countries since the practice has been dead for so long.

The bulk of the legal cases has fallen on the shoulders of neighbouring Kenya.

The United Nations is trying to figure out ways for the international community to deal with piracy prosecutions.