Dozens of Turkish hostages seized by Islamic State militants in Iraq have been freed in what Turkey's President described as a secret rescue operation.
The 49 hostages - including diplomatic staff, special forces soldiers and children - were taken from the Turkish consulate in Mosul in Iraq on June 11 after the city was overrun by Islamic State (IS) fighters.
Turkey's Prime Minister Ahmet Davutoglu said they were released after a "pre-planned operation" involving the country's intelligence services.
Mr Davutoglu hugs a child. It is not known if she is one of the hostages "After intense efforts that lasted days and weeks, in the early hours, our citizens were handed over to us and we brought them back to our country," he said.
It was not immediately clear what Turkey had done to secure the safe return of the hostages, but Turkish independent broadcaster NTV said no ransom was paid and there were no clashes with insurgents during the operation to release them.
President Tayyip Erdogan said: "I thank the Prime Minister and his colleagues for the pre-planned, carefully calculated and secretly conducted operation throughout the night.
Mr Davutoglu (L) gets on a plane with the freed hostages "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."
Police formed a cordon outside the airport in the southern Turkish city of Sanliurfa as the hostages arrived in buses with curtains drawn.
The Prime Minister, who cut short an official trip to Azerbaijan to travel to Sanliurfa, hugged the hostages before boarding a plane with them to the capital, Ankara.
The hostages were taken in Mosul and returned to Sanliurfa Mr Davutoglu did not provide further details on the circumstances of the release, but said it was carried out through "MIT's own methods".
Sky's Senior Correspondent Ian Woods said: "It seems that some sort of deal must have been done because these are people, unlike the Western hostages, journalists and aid workers, these were people who were not in the country of their own volition.
"To describe this as something co-ordinated by the intelligence service suggests that a deal has been done. It was described as a rescue mission, but we should not think of this as such because is it unlikely they could rescue all 49 people without casualties."
Seizure of the hostages put Turkey in a difficult position as a summit of 30 countries met in Paris last week to co-ordinate their response to the IS threat.
IS fighters in Mosul, Iraq. File image The nations agreed to "support the Iraqi government by any means necessary - including military assistance".
Turkey resisted joining the coalition and the United States was careful not to push Ankara too hard as it worked to free the hostages.
The hostage release comes as Turkey opened up its border to thousands of Kurds fleeing clashes with IS in neighbouring Syria.
Under tight security, the refugees, mostly women and children, crossed to the Turkish side of the border in the southeastern village of Dikmetas.
The group is still holding British hostage Alan Henning "We have taken in 4,000 brothers," Mr Davutoglu told reporters.
"The entries have started now. The number might increase. Their needs will be met. This is a humanitarian mission."
Islamic State has killed two US journalists and a British aid worker who were working in Syria in retaliation for airstrikes that Washington launched against them in Iraq.
IS is also holding two British hostages captured in Syria who have appeared in videos released by the group.
A group of Muslim scholars has made a direct appeal to IS to release hostage Alan Henning.
Mr Cantlie was seen in an IS video In a video message posted online, the men told the 47-year-old's captors that killing him would be against Islamic law.
Mr Henning, a taxi driver from Salford, was delivering aid in Syria when he was captured in December near the town of al Dana.
A video released on Thursday showing British journalist John Cantlie, who is also believed to be held by IS.

Ms Witheridge is seen leaving a bar with friends
John Cantlie
Syrian refugees crowd a Turkish border fence on Thursday
A jihadist gunman looks at bottles of perfume at a shop in Raqqa, Syria
The Pentagon chief is the latest official to rule out ground forces
A protester is removed as the Defence Secretary testifies before the House
The Islamists took 21 Syrian villages this week, sparking a refugee exodus
Mark Reilly used to run GSKCI
Peter Humphrey's health is said to be poor
President Obama and US Central Command chief, General Lloyd Austin
Secretary of State John Kerry said the group must be stopped "end of story"
A displaced Iraqi child displays his drawing at a refugee camp in Irbil
Shia fighters, who have joined the battle against IS, train in Najaf
Islamic State fighters have seized large parts of Iraq and Syria
Kurdish peshmerga troops participate in a security deployment against IS
More than 800 police officers were involved in the raids
A suspect is detained by armed police during the operation
A police forensic expert gathers evidence at a property in Sydney
Police chiefs said the operation highlighted the reality of the threat
A firefighter tackles a blaze after an apparent rocket attack in Donetsk
Ukraine's prime minister warned the country should be ready for battle
The border is one of the most heavily militarised in the world
Matthew Miller was sentenced to six years hard labour on Sunday
The group has made rapid territorial advances across Iraq and Syria
British aid worker David Haines was taken hostage and killed by the group
The group has also taken taxi driver Alan Henning hostage
Militants have released videos depicting mass executions
The US has already spent $100m (£62m) in response to the outbreak
US ebola victims Dr Kent Brantly and Nancy Writebol
Another photo shows Hurricane Odile closing in on the coast
Residents of the tourist resort and fishing town prepare for the storm
Mr Kerry speaks at a press conference in Cairo on Saturday
British aid worker David Haines has been murdered by IS extremists
Mr Kerry met Arab foreign ministers in Jeddah last week
The authorities say they have increased security at hotels and other sites
The web chat is under way so tweet your questions to @AfuaHirsch 

Mr Hammond and US Secretary Of State John Kerry arriving in Paris
Mr Cameron has vowed to 'hunt down' the 'monsters' who killed Mr Haines
A central part of the plan is to engage Arab countries in the coalition