By Oliver Hawkins
Reporter, Law in Action, BBC Radio 4
When pirate attacks off the coast of Somalia surged last year, the world sent its navies to tackle the problem. But now that we are taking the pirates on, does anyone know what to do when we catch them?
The Roman law-maker Cicero once dubbed them "enemies of all mankind". And certainly pirates have long posed a major legal problem.
It has become even more acute in recent months, following the audacious attack last November on the world's largest supertanker, the Sirius Star, off the coast of Somalia.
It is not just a question of headline-grabbing attacks on prestige ships. Vessels from states across the developed and developing world face the threat of piracy from a new generation of pirates, often from failed or failing states.
Piracy is what is known as a universal crime. That means that because the pirates commit their crimes on the high seas, beyond any one country's jurisdiction, they are treated as a threat to every country.
LISTEN TO LAW IN ACTION
BBC Radio 4, Tuesday 10 March at 1600 GMT
Or hear it later on the BBC
In turn, each country may arrest pirates at sea and prosecute them at home.
At least that is how it is supposed to work. In practice, whether a country can prosecute arrested pirates depends on its own laws.
It is a problem the Danish Navy came up against last September when the flagship Absalon detained 10 suspected armed pirates in the seas off Somalia after they had allegedly been attacking merchant ships.
"We were stuck with them," says Thomas Winkler, a legal expert at the Danish Foreign Ministry.
"We only have national criminal jurisdiction if the pirates are attacking a Danish ship or Danish citizens. So we couldn't bring them to Denmark for prosecution.
"We looked to other states, but the evidence we had was not sufficient for these states. We had to set them free and land them in a safe place on the shore of Somalia."
The Danes are not alone.
More than 100 attacks in 2008
42 successful hijackings in 2008
815 crew held hostage in 2008
6 ships currently held
Source: International Maritime Bureau, 2009
The German authorities had to release suspected pirates just before Christmas.
BBC Radio 4's Law in Action has discovered that on two occasions last year, the Royal Navy also released pirate suspects after confiscating their equipment.
Some other navies are reluctant to detain the pirates they catch for fear of becoming legally responsible for them.
The problem is particularly acute with Somalia because it lacks an effective criminal justice system.
According to Rear Admiral Philip Jones, who heads the European Union's piracy task force Operation Atalanta, when a navy intervenes to stop a pirate attack, they often do not know whether the pirates they catch can be prosecuted.
"That depends on where we find them, on the nationality of the ship that arrests them, on the nationality of the pirates themselves and the circumstances in which they are arrested.
"There is a different response available in almost every case."
The consequences of this legal labyrinth can be seen in official figures released by the US Navy at the beginning of March.
Out of the 238 suspected pirates investigated by navies operating off Somalia, barely half were sent for prosecution. Most of them were released.
Even these figures overstate the number of pirates that actually face trial because they include those handed over to the authorities in Puntland, the semi-autonomous region in the north-east of Somalia from which most pirates come.
According to Roger Middleton, in-house expert on Somali piracy at the Royal Institute of International Affairs, Chatham House, it is often unclear how long the pirates will stay in prison.
"Often not for very long," he says. "They either walk out or someone pays a bribe for them to be released."
Of the 57 pirates caught by the French Navy so far, 45 have been handed over to the Puntland authorities. The US Navy sent nine more pirates to Puntland at the beginning of March.
That means Puntland accounts for roughly half of the pirates reported to be facing prosecution.
In a bid to tackle the apparent impunity with which pirates can operate, the US and the EU have both concluded deals with Somalia's neighbour Kenya to send pirates for prosecution there.
Britain sent eight suspected pirates to Kenya last November. The US is in the process of sending another seven.
But is using Kenya as the first choice jurisdiction for prosecuting Somali pirates a viable long-term solution?
The Kenyan Foreign Affairs Minister Moses Wetangula has insisted that Kenya will not become a dumping ground for every Somali pirate captured on the high seas, despite the agreements.
And human rights groups have raised concerns about the standard of justice that pirate suspects will face there. Ben Rawlence of Human Rights Watch says there are significant problems with Kenya's justice system.
"People are routinely beaten in jail. Trials are rarely free and fair. Judges are highly susceptible to corruption," he claims.
However, the British government insists that the pirate suspects which it sends to Kenya will be treated in accordance with the UK's human rights obligations.
Everybody agrees that the long-term solution to piracy off Somalia is an effective government in Somalia with a well-resourced coast guard and a functional justice system.
Until that happens - and with civil strife in Somalia still acute - countries trying to combat piracy face huge problems in bringing pirates to justice.
Law in Action reports on topical legal stories on BBC Radio 4 on Tuesday afternoons at 1600 GMT. Or download the programme