The world's naval powers started deploying warships in the Gulf of Aden last year in an attempt to curb attacks by ransom-hunting
pirates in one of the world's busiest maritime trade routes.
The patrols have forced the pirates to shift their focus to the wider Indian Ocean, a huge area that is difficult to police with the naval force's limited resources.
A group of Somalis holding a Spanish trawler said on Tuesday they had received a $4m ransom to release the vessel and its 36 crew immediately.
"Four million dollars have been paid for the release of the Spanish ship and we're in the process of immediately releasing it," Said Abdulle, one of the pirates holding the ship told the AFP news agency.
"Technically, the ship is free. We're in the process of checking the money," Abdulle said by phone from Harardhere, northern Somalia.
He said that the group holding the trawler, the Alakrana, was in agreement over the release.
The pirates have been holding the vessel and its crew since October 2.
In addition to the $4m, the pirates had also demanded the release of two of their colleagues who were arrested at sea shortly after the Alakrana was seized and brought to Spain.
It is not known whether the pirates, who have been flown to Spain and charged with armed robbery and kidnapping, were released.
The Spanish government did not immediately comment on the claims.