Qatar has secured the release of 26 hostages, including members of the ruling family, who have spent over a year in captivity after a highly complex and sensitive negotiation.

Sources said the hostage deal was linked to one of the largest population transfers in Syria's six-year civil war.

They said it was delayed for days by an explosion a week ago that killed at least 130 people, mostly children and government supporters, waiting to be transferred.

The transfer of thousands of Syrian civilians was also tied to another deal involving 750 political prisoners to be released by the Syrian government.

The complexity of the talks highlights Qatar's role as an experienced and shrewd facilitator in hostage negotiations, this time involving members of the Gulf Arab state's ruling family.

It also raised allegations that the tiny energy-rich nation paid millions to an al Qaida-linked group to facilitate the population transfer in Syria that led to the hostages' release in Iraq on Friday.

Qatar is a member of the US-led coalition fighting the Islamic State group in Iraq and Syria.

The incident was sparked when the group was kidnapped on December 16 2015 from a desert camp for falcon hunters in southern Iraq.

They had legally entered Iraq to hunt inside Muthanna province, some 370km (230 miles) south-east of the capital, Baghdad.

A person involved in the negotiations said 11 of the captives were members of Qatar's Al Thani ruling family.

He said Qatar paid tens of millions of dollars to Shiite groups and the al Qaida-linked Levant Liberation Committee and Ahrar al-Sham, which are involved in the population transfers.

Both groups were part of an armed opposition alliance that swept through Syria's Idlib province, seizing it from government control in 2015 and laying siege to two pro-government villages now being evacuated.

The negotiator said the Qatari group was being held by Iraqi Shiite militia Kata'eb Hezbollah. The group denies it was behind the kidnapping.

He said Qatari officials were given assurances about the wellbeing of the hostages during negotiations.

Two Iraqi officials, a government and a security official, also confirmed details of the release.

The abduction of the Qatari group drew Iran, Qatar and the Lebanese Shiite militant group Hezbollah into negotiations, resulting in millions of dollars in payments to Sunni and Shiite factions, sources said.

They say the talks took place in Beirut.

The opposition-run Britain-based Syrian Observatory for Human Rights says the transfer included 800 armed men from both sides.

Rami Abdurrahman, who heads the group, said the population swap was directly tied to the issue of the kidnapped Qataris.

Citing information from negotiators he had spoken with, he said the Qataris first proposed bringing the fate of the hunting group into the talks about the besieged areas in Syria.

The population exchange has been criticised by rights groups, which say it rewards siege tactics and amounts to forcible displacement along sectarian lines.

Iraqi interior ministry official Wahhab al-Taie said the hostages had been released into the custody of the ministry. The group departed on Friday afternoon on a private Qatari jet from Baghdad.

Qatar's state TV showed their arrival from Iraq as ruler Sheikh Tamim bin Hamad Al Thani waited to receive them.

A statement on the state-run Qatar News Agency said the 26 Qatari citizens had arrived in the capital, Doha, after being kidnapped in Iraq while they were on a hunting trip.