Turkish intelligence agents brought 49 hostages seized by Islamic State militants in northern Iraq back to Turkey this morning after more than three months in captivity, in what President Tayyip Erdogan described as a covert rescue operation.

The hostages, including Turkey's consul-general, diplomats' children and special forces soldiers, were brought to the southern Turkish city of Sanliurfa in the early hours of the morning. Police formed a cordon outside the airport as they arrived in buses with curtains drawn, a Reuters witness said.

Prime Minister Ahmet Davutoglu said he was returning from an official visit to Azerbaijan to meet the group and would take them by plane to the capital Ankara.

"I thank the prime minister and his colleagues for the pre-planned, carefully calculated and secretly-conducted operation throughout the night," Erdogan said in a statement.

"MIT (the Turkish intelligence agency) has followed the situation very sensitively and patiently since the beginning and, as a result, conducted a successful rescue operation."

Speaking to reporters in Azerbaijan, Davutoglu declined to give details on the circumstances of the hostages' release.

"This was a procedure carried out through MIT's own methods. This work had intensified in recent days," he said in comments broadcast by Turkey's state-run TRT television.

The group was seized from the Turkish consulate in Mosul on June 11 during a lightning advance by Islamic State insurgents. Turkish officials had repeatedly said efforts were underway to secure their release and that the hostages were in good health but had declined to comment further.

Security sources said they were released on the Syrian side of the border with Turkey after travelling from the eastern Syrian city of Raqqa, Islamic State's stronghold.

Their capture had left Turkey, a member of the NATO military alliance and a key U.S. ally in the Middle East, hamstrung in its response to the Sunni insurgents, who have carved out a self-proclaimed caliphate in parts of eastern Syria and western Iraq, just over the Turkish border.

The rapid and brutal advance of Islamic State, bent on establishing a hub of jihadism in the centre of the Arab world and on Turkey's southern fringe, has alarmed Ankara and its Western allies, forcing them to step up intelligence sharing and tighten security cooperation.

The United States is drawing up plans for military action in Syria against Islamic State fighters, but Turkey had made clear it did not want to take a frontline role, partly because of fears for the fate of the hostages.

The militants have already beheaded two American journalists and one British aid worker, using the tactic to put pressure on Western governments after U.S. air strikes helped halt Islamic State's advances.

British and American officials have said in recent weeks that their nationals had been killed by Islamic State militants in part because other countries were paying ransoms.

France was able to secure from Islamic State the release of four of its nationals in Syria earlier this year, after what President Francois Hollande said was help from other countries.

Hollande reaffirmed on Thursday that Paris did not pay ransoms or exchange prisoners for the release of its citizens that are held hostage overseas.

Officials will not divulge the number or nationality of hostages taken in Syria for fear of putting their lives at risk. The U.S. military tried to rescue journalist James Foley and other American hostages before Foley was killed but the attempt failed because they were not at the targeted location.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.