Image copyright AFP Image caption Piracy in Somalia has declined since foreign navies started patrols

Pirates have attacked two foreign fishing trawlers off Somalia's coast, seizing the crew of one of them, maritime experts and residents say.

A Thai trawler managed to escape, following a failed attempt on Monday to hijack it in waters off central Somalia, residents told the BBC.

Pirates had seized an Iranian-flagged vessel's 15 crew after an attack in northern Somalia, officials said.

Ships and their crew are mostly held for ransom in Somalia.

Piracy in the region was at its worst in 2011, when more than 700 people were taken hostage.

There has been a sharp decline since then, with about 56 foreigners currently being held by pirates in Somalia, according to the AFP news agency.

The fall in piracy came after foreign navies - including those from the US and China - began patrolling the East African coast and private firms put armed guards on their ships.

The Iranian vessel was captured on Sunday, and appeared to be heading for the Somali coast with three pirates on board, said John Steed from Oceans Beyond Piracy, which monitors piracy, AFP reports.

"The level of illegal fishing is prompting these sort of attacks, and the potential for bringing piracy back," Mr Steed warned.

Somalis have often complained that foreign trawlers threaten the livelihoods of fishing communities along the coast, and this is the main cause of piracy.