NORFOLK, Va. -- A U.S. judge has sentenced two more Somali pirates to life in prison without parole for their roles in the shooting deaths of four Americans aboard their yacht off the coast of Africa.

Abukar Osman Beyle, 33, and Shani Nurani Shiekh Abrar, 31, will serve 21 life sentences in all, 19 of them consecutively. Ahmed Muse Salad, 27, received the same terms on Tuesday. Prosecutors had originally sought the death penalty.

The three men were among 19 who boarded the yacht in 2011 in hopes of taking the Americans back to Somalia so they could be ransomed for millions of dollars. The plan fell apart when the U.S. Navy began shadowing the boat.

With the yacht nearing the Somali coastline, a rocket-propelled grenade was fired at the U.S. destroyer. Soon after, dozens of gunshots were fired on board the yacht.

By the time U.S. Navy SEALs scrambled on board, the Americans had been mortally wounded. Four pirates also died.

The yacht's owners, Jean and Scott Adam, and their friends, Bob Riggle and Phyllis Macay, were the first Americans to be killed in a wave of pirate attacks that have plagued the Gulf of Aden and Indian Ocean in recent years.

Prosecutors said the three men who were sentenced this week were among a group of more aggressive pirates who favoured killing the Americans rather than surrendering to the Navy. Prosecutors say the men repeatedly fired AK-47s at the Americans, who were shot 41 times.

In addition to murder charges, the men were also convicted of kidnapping, hostage taking and piracy, among other things.

Eleven other men who boarded the yacht have already been sentenced to life in prison, although those sentences may eventually be reduced for co-operating with prosecutors. One person was released by U.S. authorities following the shootings because he was a juvenile.