Image caption
The skiff used by the pirates was burnt-out after the attack on the USS Ashland

A US court has sentenced a Somali man to 30 years in jail for attacking a US warship off the coast of Somalia.

Jama Idle Ibrahim was caught after an attack on a US naval flotilla which the pirates had apparently mistaken for merchant ships.

He pleaded guilty as part of an agreement which may see him return to court to testify against five other Somalis facing piracy charges.

He still faces other charges connected to an attack in 2008 on a Danish ship.

Monday's sentence was handed down at a federal court in Norfolk, Virginia.

Last week, a Norfolk jury convicted five Somalis of acts of piracy for attacking the USS Nicholas frigate, also in April. They face life in prison at a hearing set for March.

"Today marks the first sentencing in Norfolk for acts of piracy in more than 150 years," US Attorney Neil MacBride said in a statement.

"Piracy is a growing threat throughout the world, and today's sentence, along with last week's convictions, demonstrates that the United States will hold modern-day pirates accountable in US courtrooms."

At a hearing in Norfolk in August, Ibrahim pleaded guilty to attacking to plunder a vessel, engaging in an act of violence against people on a vessel, and using a firearm during a crime of violence. Both Ibrahim and the authorities had agreed to the 30-year jail term.

A judge had earlier dismissed a charge of piracy - which carries a mandatory life sentence - against Ibrahim and his five alleged accomplices because the group had not robbed, boarded or taken control of the US ship.

The gang had chased the USS Ashland in a skiff in the Gulf of Aden on 10 April, opening fire on it.

US Navy personnel returned fire, killing one Somali and wrecking the skiff.

Somalia has been ravaged by internal conflict for two decades, and pirates have flourished amid the lawlessness.