Somalia will set up a new coastguard force to combat piracy as well as to strengthen its control over its territorial waters and natural resources, the presidency said Wednesday.

A deal signed Tuesday between Somalia's defence ministry and a private company, The Atlantic Marine and Offshore Group, aims to create a coastguard from scratch for the war-torn nation, whose pirate-infested coastline is one of the longest on mainland Africa.

"Instituting a coastguard is essential for the establishment of the rule of law within Somali waters," said presidential spokesman Abdirahman Omar Osman, adding that the Netherlands-based company would provide "structure, assets and services" to develop the force.

However, no details were given as to the potential size and capability of the proposed force, nor any financial details of the deal.

The coastguard will also provide "protection of fishing grounds from illegal foreign fishing boats" as well as "protecting natural resources," Osman added, without giving any time frame for it to be set up.

The announcement follows efforts by the internationally-backed government in Mogadishu to claw back authority over Somalia's territorial waters, including areas bordering Kenya potentially rich in oil and gas deposits.

Kenya, who has had troops in southern Somalia since 2011, first as an invading force and then as part of an African Union force, lays claim to a triangle of water and oil blocs stretching for more than 100,000 square kilometres (37,000 square miles) that Mogadishu also claims.

According to the deal, the Dutch firm will "build, maintain and operate the coastguard fleet," which will include "long-range patrol vessels, equipped with high speed intervention vessels," as well as provide training.

Somalia's waters have long been plagued by pirate gangs -- still holding more than 50 hostages -- but international naval forces and armed guards on vessels have stemmed the flow of attacks.

At their peak in January 2011, Somali pirates held 736 hostages and 32 boats, some onshore and others on their vessels.

The deal promised to adhere to "applicable embargoes and restrictions" set by the United Nations.

Private companies have in the past come in for criticism for their role in setting up heavily armed coastguard forces off Somalia's semi-autonomous Puntland region, breaking the UN arms embargo.

Somalia's government in Mogadishu does not control the northeastern coastline where many of the most notorious pirate gangs are based.