WASHINGTON- For President Barack Obama, it seemed like the right thing to do, according to officials in his administration: Release five Taliban detainees at Guantanamo Bay prison in return for Bowe Bergdahl, the only known American prisoner of war in Afghanistan.

The idea of swapping Bergdahl for Taliban detainees wasn't new. It was first raised nearly four years ago and quickly ran into opposition in the administration and Congress.

"There were real big, serious issues here about whether we should exchange people, whether it would do any good" in terms of the broader Afghan peace effort, said David Sedney, a deputy assistant secretary of defense responsible for Afghanistan, who left government in May 2013.

While a rescue operation to snatch Bergdahl - believed by the U.S. government to have been held in Pakistan's tribal territories - was discussed in the years after his capture, current and former U.S. officials said the Obama administration never had enough reliable intelligence on the soldier's location to stage a raid .

Moreover, the geopolitical costs of doing so climbed steeply after the May 2011 raid into Pakistan that killed al Qaeda chief Osama bin Laden, which sparked a rapid downturn in U.S.-Pakistani relations. Another raid into Pakistani territory would have severely damaged that relationship further.