Eight Iranian sailors have been freed from captivity of pirates in Somalia, an Iranian lawmaker has announced, as efforts continue for the release of the remaining captives.

Ali Yar Mohammadi, an Iranian MP said Monday that the eight sailors were freed as a result of negotiations between Senegal’s embassy in Somalia and the pirates.

The lawmaker, who was speaking to a media outlet associated with the Iranian state TV, said head of consular officials at Iran’s Foreign Ministry had confirmed the release of the sailors.

Yar Mohammadi said the sailors were now in the Senegalese embassy in Mogadishu.

This comes six months after the crew members of an Iranian fishing vessel, which fell prey to pirates in May 2016, managed to escape from the chains of the kidnappers.

Reports suggest that 12 other sailors, from a separate Iranian boat, are still in captivity. The pirates have demanded a large ransom for their release.

Piracy used to be a major problem in the Gulf of Aden as Somali pirates frequently attacked ships, seized their cargoes and kidnapped crew members, later demanding ransom for their release. However, over the past years, the threat has largely been contained after international warships took to the area to protect trade vessels.

In line with international efforts to combat piracy, the Iranian Navy has also been conducting anti-piracy patrols in the Gulf of Aden since November 2008 to safeguard the vessels involved in maritime trade, especially the ships and oil tankers owned or leased by Iran.