Army Sgt. Bowe Bergdahl’s recovery after five years in captivity has rekindled anger among some of his military peers over how he came to fall into enemy hands and the price the United States has paid to get him back.

Bergdahl, 28, is believed to have slipped away from his platoon’s small outpost in Af­ghanistan’s Paktika province on June 30, 2009, after growing disillusioned with the U.S. military’s war effort. He was captured shortly afterward by enemy ­forces and held captive in Pakistan by insurgents affiliated with the Taliban. At the time, an entire U.S. military division and thousands of Afghan soldiers and police officers devoted weeks to searching for him, and some soldiers resented risking their lives for someone they considered a deserter.

Bergdahl was recovered Saturday by a U.S. Special Operations team in Afghanistan after weeks of intense negotiations in which U.S. officials, working through the government of Qatar, negotiated a prisoner swap with the Taliban. In exchange for his release, the United States agreed to free five Taliban commanders from the military detention center at Guantanamo Bay, Cuba.

The news was hailed by President Obama on Saturday as a sign of Washington’s “ironclad commitment to bring our prisoners of war home.” But the reaction from current and former U.S. service members was decidedly more mixed. Some said that although they were glad to see Bergdahl freed, he needs to be held accountable for his choices.

Disappearing from a military post in a war zone without authorization commonly results in one of two criminal charges in the Army: desertion or going absent without leave, or AWOL. Desertion is the more serious one, and usually arises in cases where an individual intends to remain away from the military or to “shirk important duty,” including a combat deployment such as Bergdahl’s.

1 of 33 Full Screen Autoplay Close Skip Ad × Taliban-held U.S. soldier released in exchange for Afghan detainees View Photos U.S. Army Sgt. Bowe Bergdahl, the only U.S. service member known to be held hostage in Afghanistan, was handed over Saturday morning by members of the Taliban in exchange for five Afghan detainees held at the military prison in Guantanamo Bay, Cuba, U.S. officials said. Caption U.S. Army Sgt. Bowe Bergdahl was handed over May 31 by members of the Taliban. U.S. Army Sgt. Bowe Bergdahl is seen in this undated photo. Courtesy of Kim Harrison Buy Photo Wait 1 second to continue.

Javier Ortiz, a former combat medic in the Army, said he is frustrated with Bergdahl’s actions and thinks he should be tried for desertion, even after five years in captivity in Pakistan. Many U.S. troops had misgivings about the wars in Iraq and Afghanistan while they were deployed but did not act on them as Bergdahl did, said Ortiz, of Lawton, Okla.

“I had a responsibility while I was there to the guys I was with, and that’s why this hits the hardest,” said Ortiz, who was in Iraq from March 2003 to March 2004 with the 101st Airborne Division. “Regardless of what you learned while being there, we still have a responsibility to the men to our left and right. It’s terrible, what he did.”

After he went missing, the military conducted an extensive search for Bergdahl. The plan was to create a blockade that would prevent his captors from taking him far from Paktika province, especially into Pakistan. The bulk of other operations were halted to focus on finding Bergdahl.

One Afghan special operations commander in eastern Afghanistan remembers being dispatched.

“Along with the American Special Forces, we set up checkpoints everywhere. For 14 days we were outside of our base trying to find him,” he told The Washington Post, speaking on the condition of anonymity because he is a member of a secretive military unit.

But U.S. troops said they were aware of the circumstances of Bergdahl’s disappearance — that he left the base of his own volition — and with that awareness, many grew angry.

“The unit completely changed its operational posture because of something that was selfish, not because a soldier was captured in combat,” said one U.S. soldier formerly based in eastern Afghanistan who spoke on the condition of anonymity because of the sensitivity of the search. “There were military assets required . . . but the problem came of his own accord.”

In exchange for the release of U.S. Army Sgt. Bowe Bergdahl, the U.S. agreed to free five Taliban commanders from the military detention center at Guantanamo Bay, Cuba. They were among the Taliban’s most influential commanders. (Tom LeGro and Natalie Jennings/The Washington Post)

The search in Paktika was eventually called off, after U.S. officials acknowledged that Bergdahl had been taken to Pakistan.

The details of the search for Bergdahl were explored in a long online comment that was posted a year ago beneath a 2012 Rolling Stone magazine profile of the missing soldier by the late journalist Michael Hastings. The text of the comment was distributed widely on social media after news about Bergdahl’s rescue broke. The comment attributed the deaths and woundings of several U.S. soldiers to the search for Bergdahl and asserted that the frequency of enemy ambushes and improvised explosive devices increased after he was gone.

“The Taliban knew that we were looking for him in high numbers and our movements were predictable,” said the comment, written by an anonymous poster who used military jargon and claimed to have been there.

“Because of Bergdahl, more men were out in danger, and more attacks on friendly camps and positions were conducted while we were out looking for him,” it continued. “His actions impacted the region more than anyone wants to admit.”

Those sentiments were underscored in a long series of tweets that were posted Saturday night and went viral online. Using the Twitter handle @CodyFNfootball, the writer said he was on base at the time and believes that Bergdahl planned his escape for days, leaving between 3 and 4:30 a.m., when there was the least amount of light. The following day, the troops there questioned Afghan children nearby, who said they had seen an American crawling through weeds.

“While searching for him, ambushes and IEDs picked up tremendously,” one of the tweets said. “Enemy knew we would be coming.”

The Washington Post contacted the individual running the Twitter account but received no reply. Like the Rolling Stone comment, however, the tweets included enough specifics about Bergdahl’s unit and location to be regarded as potentially credible by many discussing the case.

Defense Secretary Chuck Hagel, speaking to reporters Sunday in Bagram, Afghanistan, declined to talk about any possible action by the military against Bergdahl. A senior defense official indicated that punitive action was unlikely, no matter what the circumstances were. “Five years is enough,” he said.

Current and former service members also questioned whether the United States should have released five members of the Taliban in exchange for Bergdahl. Former Sgt. Aaron King, who deployed to Iraq twice as part of the 101st Airborne Division, said that Washington needed to try to recover Bergdahl but that U.S. troops join the military knowing that they could be kidnapped. He also said that troops accept that although their fellow service members will search for them, they are not to be used in negotiations.

“We’re giving up too much for this individual,” said King, of Washington, D.C. “Five guys are getting back out into the world to probably conduct terror operations and harm others.”

Sieff reported from Kabul.

Karen DeYoung in Bagram contributed to this report.