A Somali pirate on a beach in the town of Hobyo. (File picture: Roberto Schmidt)

Drought and famine seem to be fuelling a resurgence of piracy off the coast of Somalia, the United States' top military chief in Africa said Sunday.

Half a dozen pirate attacks have been reported in the region over the last month, after falling to zero in recent years, said US general Thomas Waldhauser.

"Some of the reasons we see for that have to do with the drought and famine" because some of the vessels seized have been carrying food and oil, he said.

The targeted boats have been small and "very lucrative targets for pirates", Waldhauser told a press conference with US Defense Secretary Jim Mattis in Djibouti.

The US military is advising shipping companies and ensuring they stick to security guidelines and do not lower their guard, he said.

"The bottom line is that there have been half a dozen or so" attacks but "we are not ready to say that there is a trend," he added.

Mattis travelled to the tiny strategic state of Djibouti in the Horn of Africa because it hosts the only permanent US military base on the African continent, Camp Lemonnier.

Somali pirates began staging attacks in 2005, seriously disrupting a major international shipping route and costing the global economy billions of dollars. At the peak of the piracy crisis in January 2011, 736 hostages and 32 boats were held.

Though anti-piracy measures ended attacks on commercial vessels, fishing boats have continued to face attacks sporadically.