“The defendants are guilty of the attack on sea transport in conjunction with extortionary kidnapping,” the judge at the court in the northern port city of Hamburg, Bernd Steinmetz, said.
The defendants, believed aged between 19 and 50, went on trial in November 2010 but the case has been marred by complications, not least confusion over the Somalis' full names and exact ages.
They were arrested by the Dutch navy some three and a half hours after they took over the German container ship Taipan some 950 nautical kilometers (530 miles) off the Somali coast in April 2010.
The Taipan's 15-member crew managed to evade capture by the pirates by taking refuge in a so-called “panic room” hidden within the ship.
Prosecutors had called for lengthier terms of four to 12 years.
Some of the defendants urged the court Friday to show clemency, stressing Somalia's humanitarian situation after being ravaged by civil war and hunger for many years.
“My homeland has collapsed. I beg the presiding judge, be fair,” one said through a court interpreter.
After a spike at the start of the last decade, successful pirate attacks on commercial vessels sailing off the Horn of Africa have diminished, deterred by an international deployment of warships to patrol the coast.
In 2011 some 176 attacks were recorded, while 34 took place so far this year, said the latest statistics from Operation Atalanta, the European Union's anti-piracy deployment to the region.
Pirates currently control six ships and hold an estimated 156 crew members hostage.
Other European countries and the United States have prosecuted Somali defendants but Germany had not seen a pirate trial for more than 400 years.
Between 1390 and 1600, 533 pirates were tried and executed in Hamburg, Germany's richest city which made its fortune from maritime trading, according to local historian Ralf Wiechmann.