The United Nations Security Council on Tuesday authorized nations fighting piracy along Somalia's coast to take action inside the country and in its airspace, pending approval from the Somali government.

More than 40 vessels have been seized by pirates along Somalia's 3,000-kilometre coastline this year, netting pirates tens of millions of dollars in ransom.

Tuesday's motion, passed unanimously by the 15-member Security Council, applies to piracy-fighting countries that Somalia's interim government has told the UN it is working with.

The motion says those states "may undertake all necessary measures in Somalia, including in its airspace, for the purpose of interdicting those who are using Somali territory to plan, facilitate or undertake acts of piracy and armed robbery at sea."

Nations are urged to "take part actively" in the fight against piracy.

Any measures must be "consistent with applicable international humanitarian and human rights law," the motion reads.

Countries must get permission from Somalia's government before taking action, says the motion, which passed during a session attended by U.S. Secretary of State Condoleezza Rice, Russian Foreign Minister Sergei Lavrov and British Foreign Secretary David Miliband,

Neighbouring countries should help: UN

Earlier Tuesday, officials with the UN Office on Drugs and Crime said the only solution to the growing problem is to bring the pirates to justice in regional courtrooms.

"Pirates cannot be keelhauled or forced to walk the plank, nor should they be dumped off the Somali coast. They need to be brought to justice," the agency's executive director, Antonio Maria Costa, said.

Suspects should ideally be handled by their native country or by countries where the seized ship is registered, the agency said.

It noted, however, that the Somali criminal justice system is in tatters and the countries where most of the ships are registered — Liberia, Panama and the Marshall Islands — have no interest in dealing with the hijackings.

Instead, the agency recommended deploying officers from neighbouring countries to accompany warships, then arrest the pirates and bring them to those neighbouring countries for trial. Among the possible countries mentioned were Djibouti, Kenya, Tanzania or Yemen.

A similar method was successfully used to fight drug traffickers in the Caribbean, the agency said.

New hijackings

Warships have recently been accompanying boats to protect them while crossing the most dangerous waters, where dozens of ships have been hijacked for ransom.

Some of the boats seized were carrying UN food supplies headed to Somalia.

The problem came under worldwide scrutiny when Somali pirates pulled off the daring capture of a Saudi supertanker off the coast of Kenya. It was the largest ship ever taken and had a cargo of crude oil worth more than $100 million.

The latest hijacking occurred Tuesday and involved a tugboat operated by a French oil company and a Turkish cargo ship.

Before the latest seizures, maritime officials estimated 14 still remained in pirate hands, including the Saudi supertanker.

With files from the Associated Press