Members of the Qatari royal family held hostage in Iraq since 2015 were among 26 Qataris released on Friday, a Qatari source told CNN.
A Qatari plane carrying a 14-member delegation had been standing by at Baghdad International Airport to take them home, an airport official said. The Iraqi Interior Ministry said all 26 had left the country on Friday afternoon.
Media reports have connected the fate of the hostages to a complex deal, brokered in part by the Qatari government, to evacuate four besieged towns in Syria.
The deal -- a population swap between rebel and regime areas in Syria -- has resumed following a car bomb that killed 126 evacuees from the northern Shia towns of al-Fu'ah and Kafraya on Saturday.
A Qatari source confirmed that Qatar had helped sponsor the Syria deal, but denied that it had anything to do with the hostages in Iraq.
"In regards to the four towns agreement in Syria, Qatar has sponsored negotiations since the beginning of 2015," the source told CNN's Becky Anderson. "It's completely humanitarian and has nothing to do with Qatari hostages in Iraq."
Iraqi officials said they had "received" the group of Qatari "hunters". Iraq's Interior Ministry said their passports were checked, photographs and fingerprints taken before they were handed over to Qatari officials.
In his weekly press conference Tuesday, the Iraqi Prime Minister Haydar al-Abadi said his government had been doing its best to free the group.
"Qatari citizens came to Iraq with official visas granted by the former Interior Minister and they should have been under the protection of the Interior Ministry specifically, but unfortunately they were kidnapped in [the predominantly Shia] Muthanna province," Abadi said.
"It has been about a year and a half since their kidnapping, we have exerted a great deal of effort to secure their release, to obtain any information that would lead to their release," Abadi added.
Meanwhile the "four towns" population swap continued on Friday.
Ten buses carrying scores of locals from the rebel besieged towns of al-Fu'ah and Kafraya entered government-held Aleppo following a delay of about 48 hours, the official Syrian news agency SANA reported.
The news agency said they were headed to the Jibrin area, east of Aleppo, where local authorities had prepared makeshift reception centers for them.