An American deal to free five high-ranking Taliban militants in exchange for an American soldier violates international law because of the transfer of the men from a Guantanamo Bay jail to Qatar, Afghanistan's government says.
The Afghan detainees were released from the United States prison in Cuba and handed to Qatar, which mediated the deal.
US Sergeant Bowe Bergdahl had been held by the Taliban for nearly five years. The operation to release the 28-year-old on Saturday was so secret that Afghanistan's President Hamid Karzai was not told until after it had happened.
After calling in Afghan officials responsible for trying to make peace with the Taliban on Afghan terms, Mr Karzai's government has expressed strong opposition to the US deal.
A statement claimed that handing the Taliban fighters over to the third power, Qatar, was against international law, the BBC reports.
Earlier in a rare public statement, Taliban leader Mullah Mohammad Omar called the release a great victory.
Meanwhile, Sergeant Bergdahl is in a good condition and undergoing medical care at a US military hospital in Germany before flying home.
Jani Bergdahl said she looks forward to seeing her son soon. "Five years is a seemingly endless long time, but you've made it. I imagine you're more patient and compassionate than ever, you are free. I will see you soon, my beloved son."
The swap has also sparked a political row in the US. Republican Party politicians said it set a dangerous precedent and believed it would put other Americans in Afghanistan at risk.
US Defence Secretary Chuck Hagel, on a routine visit to Afghanistan, defended the deal and called it an exchange of prisoners of war.
Mr Hagel believed he was justified in not telling Congress until after the deal was done. "This was essentially, in our opinion, to save the life of Sergeant Bergdahl."
Republicans doubt that the Qatar government would be able to guarantee promised restrictions on their movements.