New York (CNN) -- A federal court sentenced a Somali man to nearly 34 years in prison Wednesday for acts related to high-seas piracy after he and three other men hijacked a U.S.-flagged ship as it cruised past the Horn of Africa.

Abduwali Abukhadir Muse pleaded guilty to the 2009 hijacking of the Maersk Alabama and for subsequently taking the ship's captain hostage.

He was sentenced to 405 months in prison.

"I'm sorry very much for what happened to victims on ship, I am very sorry about what I caused," Muse said. "I was recruited by people more powerful than me."

He asked "forgiveness for all the people I harmed and the U.S. government."

Muse was also sentenced for his participation in the hijacking of two other vessels in late March and early April of 2009, which also involved the taking of hostages.

He pleaded guilty on May 18, 2010, to two felony counts of hijacking maritime vessels, two felony counts of kidnapping, and two felony counts of hostage taking, according to a U.S. attorney statement.

"For five days that must have seemed like an eternity to his victims, Abduwali Abukhadir Muse terrorized the captain and crew of the Maersk Alabama," said Manhattan U.S. Attorney Preet Bharara. "Now he will pay for those five days and the events leading up to them."

The attack occurred in the Gulf of Aden between the Horn of Africa and the Arabian Peninsula.

In the hijacking, U.S. Navy SEALs ultimately rescued the ship's captain, Richard Phillips, while he was held hostage in a lifeboat not far from the Alabama.

Phillips was initially hailed as a hero for his actions in exchanging himself for the safety of his crew. Later, many of those crew members told CNN that Phillips had ignored several explicit warnings that urged him to stay away from the shipping lanes where the attack took place.

Phillips returned to sea about a year after that attack and was not reassigned to the Alabama.

Until last year, there had not been a piracy-related conviction in the United States since 1861, during the Civil War, officials said.

Some 685 sailors are currently being held for ransom aboard 30 ships off the Somali coastline, according to the International Maritime Organization.

Somalia-based pirates often hijack ships to be used as bases, or mother ships, for launching further attacks, using the ships' crews as "human shields," the organization said in a written statement.

Muse was the only survivor among the men who hijacked the Alabama and was commonly kept in solitary confinement while awaiting trial, according to his defense attorney Fiona Doherty.

He twice tried to take his own life, Doherty said.

His attorneys had asked for leniency, citing the impoverished conditions in the war-torn country in which the 19-year-old had lived.

One in six Somali children is acutely malnourished, considered the highest acute malnutrition rate in the world, according to a recent U.N. World Food Programme report.

In 2010, the United Nations suspended the delivery of food assistance in southern Somalia due to growing insecurity from armed groups in the region.