Obama United States Bowe
U.S. President Barack Obama stands with Bob Bergdahl (R) and Jami Bergdahl (L) as he delivers a statement about the release of their son, prisoner of war U.S. Army Sergeant Bowe Bergdahl, at the White House. Reuters

Five Taliban leaders have arrived in Qatar after being freed from Guantanamo Bay in a swap deal for the kidnapped US soldier Bowe Bergdahl, who was held in Afghanistan for almost five years.

The Taliban's supreme leader Mullah Omar lauded their release as a "big victory" for the group.

"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.

"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 Qatari foreign minister Khalid bin Mohamed Al Attiyah said that its role as a mediator was purely for humanitarian reasons.

"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.

Sergeant Bowe Bergdahl
Sergeant Bowe Bergdahl was said to be weakened and scared after five years in a Taliban prison.

A senior White House official said that the released leaders would be "subject to restrictions on their movements and activities".

The official told Al Jazeera that the Guantanamo prisoners would not have been released "unless the threat they may pose to the US can be mitigated".

Sergeant Bergdahl was taken prisoner in the Paktia Province of Afghanistan on June 30, 2009.

Several dozen US Special Forces were involved in the exchange, they said, which took place near the Pakistani border.

Sources say he is "weakened, scared and vulnerable", and is undergoing a medical examination in Germany.

Commenting on the return of the missing soldier, US President Barack Obama said America was committed to leaving no soldier behind.

"Sergeant Bergdahl's recovery is a reminder of America's unwavering commitment to leave no man or woman in uniform behind on the battlefield. And as we find relief in Bowe's recovery, our thoughts and prayers are with those other Americans whose release we continue to pursue."