The men were also sentenced on Monday to serve an additional 80 years in prison on other charges after they were found guilty in November of trying to hijack the USS Nicholas, a vessel on an anti-piracy mission.
Defense lawyers had argued the men were innocent fishermen who had been abducted by pirates and forced to fire their weapons at the ship.
Most of the men said through an interpreter they wanted to appeal the conviction and sentencing.
Their prosecution was the first for piracy in nearly 200 years.
“Today’s sentences should send a clear message to those who attempt to engage in piracy: Armed attacks on US-flagged vessels carry severe consequences in US courts,” said US Attorney Neil MacBride.
He told reporters the sentence handed down by Judge Mark Davis was the longest ever in a piracy conviction, because the pirate convicted in 1820 was hanged.
The trial took place in Norfolk in the US state of Virginia, one of the largest naval bases in the world and home port to the USS Nicholas.
The crew of five young defendants, mostly fishermen in their mid-20s, had set sail from Somalia in March in search of a merchant vessel to plunder, according to documents filed in the federal court.
The men said they were promised thousands of dollars for the hijack.