Ten suspected Somali pirates are due to be extradited from the Netherlands to stand trial in Germany.
A court in Amsterdam approved their extradition after rejecting defence arguments that they should be tried in the Netherlands.
The 10 were captured by Dutch navy commandos after an attack on a German cargo ship off the Somali coast in April.
Prosecutors in Hamburg are expected to charge the 10 with hijacking.
The judge at Amsterdam's district court ruled that while the Netherlands had the power to try the men, it was not sufficient grounds for refusing extradition to Germany.
"Although the suspects have asked to be tried in the Netherlands there is no ground in the extradition agreement for the [Dutch] officer of justice to prosecute them further," the judge said.
Defence lawyers have argued that the attacked ship had been registered in the Bahamas and not in Germany as was claimed.
"If we can prove that we don't know under which flag the ship was going, if we can prove that there is no documents, who is the owner of the ship, why does the court now say so easily, it's enough, you have to go to Germany?" lawyer Michael Balemans told Reuters news agency.
The MV Taipan freighter was seized some 900 km (560 miles) east of the Somali coast in early April.
The Dutch navy frigate Tromp - patrolling the waters as part of an EU anti-piracy operation - responded to a distress signal from the Taipan.
Commandos abseiled from a Lynx helicopter on to the ship after learning that the crew had locked themselves in a bullet-proof room. All the crew were released unharmed, although one soldier was slightly injured.