The European Union is to expand its naval anti-piracy mission to include for the first time Somali "coastal territory and internal waters".
The operation, which started in 2008, will be extended until at least the end of 2014, said EU foreign ministers meeting in Brussels.
A statement said Somalia's transitional government has accepted the EU's offer for greater collaboration in the operation.
Pirate attacks on international merchant shipping in the Indian Ocean and Red Sea have been in steady decline in the past 12 months.
The EU keeps 5-10 warships off the Horn of Africa in an operation known as Atalanta.
Nato has a similar anti-piracy flotilla known as Ocean Shield, and other countries have dispatched naval vessels to patrol the region.