Abdiwali Abdiqadir Muse has been jailed in Manhattan since he was captured last year and faced what was called the first U.S. piracy prosecution in decades.
"I am very, very sorry about what we did," he said through an interpreter. "All of this was about the problems in Somalia."
He also pleaded guilty to hostage-taking and conspiracy. He faces a minimum 27 years in prison. Sentencing was set for Oct. 19.
Prosecutors branded Muse the ringleader of a band of four pirates who provoked a deadly drama by targeting the Maersk Alabama on April 8, 2009, as it transported humanitarian supplies about 280 miles off the coast of Somalia.
The case could be the first of several piracy prosecutions in U.S. courts. It's part of a larger U.S. policy debate over how best to deal with the insurgents and criminal activities that contribute to the persistent instability in Somalia, making it a haven for al Qaeda-linked terrorists.
In the Maersk Alabama case, a criminal complaint said Muse was the first to board the ship, firing his AK-47 assault rifle at the captain, Richard Phillips. He entered the bridge, told the captain to stop the ship and "conducted himself as the leader of the pirates," the complaint said.
The four pirates held Phillips, of Underhill, Vt., hostage for several days on a sweltering, enclosed lifeboat that was soon shadowed by three U.S. warships and a helicopter. The standoff ended when Navy snipers fatally shot three of the pirates.
Muse's age has been in dispute since the start of the case. Last April, his lawyers insisted he was 15 and should be tried as a juvenile. Prosecutors convinced a judge he was at least 18.
Earlier this year, prosecutors alleged that Muse and others tried to seize the two ships in the Indian Ocean in the weeks leading up to their capture of the Maersk Alabama.
Court papers, which didn't name the other ships, alleged Muse threatened to kill the crew of the first vessel with "what appeared to an improvised explosive device" after its capture in March 2009.
The Navy has taken into custody more than 20 suspected pirates in the violence-plagued waters off Somalia and nearby regions, where U.S. warships are part of an international anti-piracy flotilla.
U.S. officials have said they hope to bring federal charges against some of the other suspects. There also have been preliminary discussions about setting up a special international court, because a number of countries will not act against suspected pirates who are turned over to them.