The release of Army Sgt. Bowe Bergdahl in exchange for five senior members of the Taliban has been both welcomed as well as criticized.

Here's a look at why the release of a prisoner of war, usually a cause for unalloyed celebration, is proving so divisive.

Who is Bowe Bergdahl?

Bergdahl is an American soldier from Hailey, Idaho, who was captured by the Taliban in June 2009. At the time of his capture, Bergdahl held the rank of private first class, but he was promoted in absentia to sergeant in June 2011.

Here's more from Jessica Robison of the Northwest News Network, who has been following the case closely:

"He defied stereotypes. Around town, he was known as an excellent marksman, and a ballet dancer. He loved to be alone in the mountains but was also happy just talking to people in town. Friends say Bergdahl also craved a way to do something important in the world — and in 2008 Bergdahl saw enlisting in the Army as his opportunity."

How was he captured?

Details are murky. In a video released by the Taliban a month after his capture, Bergdahl said he lagged behind while on patrol.

The Associated Press has varying accounts of how he disappeared. In one, U.S. officials said the soldier walked off his base with three Afghans. Another account suggested Bergdahl was captured during an attack on his post. The Taliban, meanwhile, said they'd captured a "drunken American soldier."

What is the reaction to his release?

At a news conference in Boise, Idaho, Bob Bergdahl, Bowe's father, said he was proud of his son's commitment to the Afghan people. His mother, Jani Bergdahl, said: "Five years is a seemingly endless long time, but you've made it. ... You are free. Freedom is yours. I will see you soon, my beloved son."

And as Jessica Robison reported on Monday's Morning Edition, residents of Hailey welcomed the release.

"To have Bowe home safely is the most important thing," said Carmen Northen, who attends the same Presbyterian church as the Bergdahls.

Those sentiments were echoed by the Boise Valley POW/MIA Corp.

But those views are far from universal. Some congressional lawmakers criticized the manner in which he was released, and some service members have criticized Bergdahl's reported actions.

Why the controversy?

There are two aspects to this question: The first is Bergdahl's reported views and possible actions, and the second is the Obama administration's handling of the negotiations that led to the soldier's release.

The first: In 2012, Rolling Stone published what it said were emails sent by Bergdahl to his parents soon after his deployment to Afghanistan. In them, the soldier said he was considering deserting from the Army because he was disillusioned.

The emails quote Bergdahl saying he was "ashamed to even be American."

Also, as The Washington Post reports, many of his fellow soldiers consider Bergdahl a deserter who "needs to be held accountable for his choices."

The second: Many lawmakers are concerned that the senior Taliban officials released in exchange for Bergdahl may return to action. The five were considered likely to pose a "threat to the U.S., its interest and allies."

But as NPR's Eyder Peralta noted on Saturday: "U.S. officials said working with the government of Qatar, they had ameliorated some of those risks, because the detainees will face restrictions on their movements and activities."

Lawmakers are also concerned that the administration negotiated with the Taliban. But administration officials point out that the talks were indirect and were mediated by the government of Qatar. Also, the Afghan Taliban does not appear on the U.S. State Department's list of foreign terrorist organizations (the Pakistani Taliban is on the list).

One more point of concern: The administration is required by law to give Congress 30 days' notice before prisoners are released from Guantanamo Bay. But as NPR's Tamara Keith reported on Monday's Morning Edition: "The Department of Defense consulted with the Department of Justice and concluded that there were unique and exigent circumstances."

Despite the administration's assurances, Tamara says: "You can better believe that there will be a whole slew of congressional hearings on all aspects of this."

Further reading

Behind Bowe Bergdahl's Release, A Secret Deal That Took Three Years

Mixed Reaction To Bergdahl's Recovery By Service Members Who Consider Him A Deserter

America's Last Prisoner Of War

Copyright 2016 NPR. To see more, visit http://www.npr.org/.