* Karzai angry at secret prisoner swap - source
* Afghan leader says U.S. failed to back peace process
* Sergeant Bergdahl at medical facility in Germany
* U.S. ambassador to Kabul says Karzai was aware
The five prisoners were flown to Qatar on Sunday as part of a secret agreement to release Army Sergeant Bowe Bergdahl, who left Afghanistan for Germany on the same day.
The only known U.S. prisoner of war in Afghanistan, Bergdahl had been held captive for five years.
"The president is now even more distrustful of U.S. intentions in the country," said the source close to President Hamid Karzai's palace in Kabul, who declined to be identified.
"He is asking: How come the prisoner exchange worked out so well, when the Afghan peace process failed to make any significant progress?"
Karzai has backed peace talks with the hardline Islamist Taliban movement, which ruled Afghanistan between 1996 and 2001 and has fought a bloody insurgency since then against U.S.-led forces in the country.
But they have come to little so far, and the group moved swiftly to dash hopes that the prisoner swap would rekindle negotiations between it and the Afghan government.
"It won't help the peace process in any way, because we don't believe in the peace process," Taliban spokesman Zabihullah Mujahid said on Sunday.
The official close to the palace also said Karzai was worried about further deals being cut without his knowledge.
"It indicates that other deals could be negotiated behind the president's back," he said.
"THEY AGREED TO IT"
U.S. ambassador to Afghanistan James Cunningham, speaking to reporters in Kabul, said the Karzai administration had been made aware of the impending prisoners' swap.
"It's not behind the government's back. The government's known that we're trying to (do) this for a long time, and they agreed to it and they supported it," he said.
"The only thing that was not transparent to anybody was the actual timing - the fact that there was an agreement and the timing. It certainly doesn't undermine the government and they never expressed any concern to us that it would undermine the government."
Karzai has yet to comment publicly on a swap that is bound to deepen the mistrust of a leader who has been fiercely critical of the U.S. administration in recent years.
He is due to step down as president later this year, but many Afghans believe Karzai will continue to wield considerable influence over policy from behind the scenes.
Karzai's press office said in a statement that the U.S. deal to transfer five Taliban militants from a Guantanamo Bay jail to Qatar violated international law.
"No government can transfer citizens of a country to a third country as prisoners," said the statement, issued on behalf of the foreign ministry.
The prisoner swap has stoked widespread anger in Afghanistan, where many view it as a sign of a U.S. desire to disengage from the country as quickly as possible.
Washington has mapped out a plan to fully withdraw all of its troops by the end of 2016.
TALIBAN LEADERS IN QATAR
Under the terms of the deal, cut by Qatari intermediaries, the five Taliban detainees were released from Guantanamo Bay, Cuba, where they had been held since it opened in 2002, and flown to Qatar where they must stay for a year.
Senior officials at the Afghan intelligence agency said they believed the men would return to the battlefield and bolster the insurgency just as most foreign combat troops prepare to exit by the end of this year.
All five were classed as "high-risk" and "likely to pose a threat" by the Pentagon and held senior positions in the Taliban regime before it was toppled by a U.S.-led coalition in 2001.
At least two of them are suspected of committing war crimes, including the murder of thousands of Afghan Shi'ites, according to leaked U.S. military cables.
The swap has similarly drawn protest from U.S. Republican politicians who have called it negotiating with terrorists and warned the freed men will likely return to battle.
While Bergdahl's release on Saturday was celebrated by his family and his hometown, and could be seen as a coup for President Barack Obama as he winds down America's longest war, Senator John McCain and other Republicans questioned whether the administration had acted properly in releasing the militants.
"These are the highest high-risk people. Others that we have released have gone back into the fight," said McCain, a former prisoner of war and Vietnam War veteran.
"That's been documented. So it's disturbing to me that the Taliban are the ones that named the people to be released," he said on CBS' "Face the Nation".
As the Obama administration sought to counter the criticism, Bergdahl was flown to Landstuhl Regional Medical Center in Germany for medical treatment.
After receiving care he would be transferred to another facility in San Antonio, Texas, U.S. defense officials said, without giving a date for his return to the United States.
U.S. Defense Secretary Chuck Hagel said he hoped the exchange might lead to breakthroughs in reconciliation with the militants and rejected accusations from Republicans that it resulted from negotiations with terrorists, saying the swap had been worked out by the government of Qatar.