Five Taliban leaders have arrived in Qatar after being freed from Guantanamo Bay in a swap deal for a US soldier held in Afghanistan for nearly five years.

The prisoners were flown by US military C-17 aircraft into the Gulf on Sunday. They were named on Saturday as Mohammad Fazl, Mullah Norullah Noori, Mohammed Nabi, Khairullah Khairkhwa and Abdul Haq Wasiq.

The Taliban's supreme leader, Mullah Omar, on Sunday hailed their release as a "big victory".

"I extend my heartfelt congratulations to the entire Afghan Muslim nation, all the mujahideen and to the families and relatives of the prisoners for this big victory," he said in a statement on Sunday.

"I thank the government of Qatar, especially its emir Sheikh Tamim bin Hamad [Al Thani], who made sincere efforts for release of these leaders and for their mediation and for hosting them."

The men were swapped for Bowe Bergdahl, a 28-year-old army sergeant who had been held by the Taliban since June 30, 2009.

The Qatari foreign minister, Khalid bin Mohamed Al Attiyah, said his country's role was purely humanitarian.

"When Qatar takes the role of intermediary, it plays this role on a humanitarian basis which is the whole concept of Qatar foreign relations," he said.

The five Taliban are understood to be limited to living in Qatar for their first year of freedom, a condition that the Afghan government on Sunday said was against "international law" and called for their immediate release.

A White House official told Al Jazeera on Saturday that the US administration would not have transferred prisoners from Guantanamo "unless the threat they may pose to the US can be mitigated".

He said the Taliban prisoners would be "subject to restrictions on their movement and activities".

The five were high-ranking members of the Taliban government toppled by the US in 2001. Fazl was the deputy defence minister, while Noori was the governor of Balkh province.

Bergdahl was handed to US troops by the Taliban on Saturday evening in an area of eastern Afghanistan near the Pakistan border. Officials said the exchange was not violent and Bergdahl was in good condition and able to walk.