Rep. Richard B. Nugent, a Republican lawmaker whose three sons have served in the military, made the case of captive soldier Bowe Bergdahl a personal cause. He delivered ­speeches about Bergdahl on the House floor. He introduced two resolutions affirming that the United States would not abandon him in Afghanistan.

What Nugent wanted, he told a crowd at a rally for Bergdahl’s release in February, was for “the United States to do everything possible not to leave any members of the armed forces behind.”

But today, Nugent says that when he said “do everything possible,” did not actually mean everything. Now that Bergdahl is free, the Florida congressman has become a critic of the deal that freed him.

Nugent believes that the Obama administration gave away too much by sending back five Taliban commanders held at Guantanamo Bay, Cuba, and that it did not follow the law on consulting members of Congress.

“Doing ‘everything possible’ in my mind does not include breaking the law and jeopardizing national security,” Nugent said in a written statement.

PostTV and Dan Lamothe of The Washington Post’s new Checkpoint blog point out key moments in the video released by the Taliban showing Sgt. Bowe Bergdahl's recovery. (Dan Lamothe and Sarah Parnass/The Washington Post)

“It doesn’t mean the Commander in Chief should go give them a nuclear weapon or whatever else they want in exchange for Bergdahl. Basic judgment tells you that. People on both sides think he’s put our troops and our allies at undue risk” by sending back the Taliban leaders, Nugent said.

For America’s political class, the plight of Bergdahl — the last soldier held captive in either Iraq or Afghanistan — was once a straightforward matter. They wanted him free.

Then he was free. And people from both parties didn’t know what to think about him anymore.

On Sunday, for instance, national security adviser Susan Rice had praised Bergdahl in the hours after he was released. The soldier “served the United States with honor and distinction,” she said then.

But on Friday, Rice said she had been misunderstood and only meant to praise Bergdahl for joining the Army in the first place.

“What I was referring to is the fact that this was a young man who volunteered to serve his country in uniform at a time of war. That is itself a very honorable thing,” Rice said in an interview on CNN.

Sen. Jeanne Shaheen (D-N.H.) had initially written that she was “thankful for [Bergdahl’s] service, his sacrifice, and his courage.”

But, by Wednesday, Shaheen seemed more skeptical about Bergdahl’s case. “I fully expect . . . that there will be a full investigation into Bergdahl’s separation from his unit, and that appropriate actions will be taken,” she wrote.

Several members of Congress from both parties issued tweets celebrating Bergdahl’s return, only to delete them as the story grew murky.

The shifts in rhetoric are particularly pronounced among Republicans who long demanded that Obama do more to secure Bergdahl’s release. After the deal was announced, many reversed their positions and criticized Obama for sacrificing too much to get him.

Democrats and cable-news talkers immediately mocked them for playing politics. “It is clear they are worried his release could be seen as a victory for President Obama,” Senate Majority Leader Harry M. Reid (D-Nev.) said on the Senate floor Wednesday.

In interviews and statements, some in the group say they did not contradict themselves. They said they always wanted Bergdahl back and expected it might take a deal with the Taliban. Indeed, the broad outlines of this deal — including the five Taliban commanders to be exchanged — had been discussed publicly since at least 2011.

But still, these conservatives say, they didn’t expect the final deal would be this bad.

In February, The Washington Post reported on the revival of talks to free Bergdahl in exchange for releasing five Taliban commanders held at Guantanamo Bay into the custody of Qatar — the exact outlines of the deal that was eventually announced. When asked about the reports at the time by CNN’s Anderson Cooper, Sen. John McCain (R-Ariz.) said he might support an agreement for Bergdahl that included some kind of prisoner exchange.

“Obviously I’d have to know the details, but I would support ways of bringing [Bergdahl] home, and if exchange was one of them, I think that would be something I think we should seriously consider,” McCain said.

But after Obama announced Saturday that he had swapped the Taliban prisoners for Bergdahl, McCain criticized the exchange as “a mistake.”

On Thursday, a spokesman for the senator said that if McCain had been presented with the offer that Obama accepted, he would have said no.

“What he was saying [in February] is, ‘I’d love to get this guy. I’d be inclined to support a deal. But it would obviously come down to what the terms are,’ ” said Brian Rogers, the McCain spokesman. “To take what he said and to suggest that he would support any deal is obviously unreasonable. He wouldn’t support anything.”

Other legislators who had supported Bergdahl’s release said they were outraged by how little Obama told Congress about the deal before it happened. The National Defense Authorization Act of 2014 requires that the administration notify Congress at least 30 days in advance of a Guantanamo detainee release.

In this case, that didn’t happen. Reid said he was given a one-day notice of the deal, but many other congressional leaders — including top Republicans — were not.

Sen. Tim Scott (R-S.C.), who had earlier supported a resolution calling for the United States to not leave soldiers behind in Iraq and Afghanistan, has criticized the way it was done.

“Senator Scott believes that we should leave no man or woman in uniform behind and that the President should follow the law,” a spokesman for Scott wrote Thursday. “These are not contradictory views; they are what both our troops and the American people as a whole deserve.”

The reversals were not confined to Congress. In 2009, former Alaska governor and vice-presidential candidate Sarah Palin had said she was praying for Bergdahl. This week on Facebook, she called him “the sketchy ‘I’m-ashamed-to-be-American’ Sgt. Bergdahl.”

Former congressman Allen B. West (R-Fla.) wrote in December that Obama was neglecting the soldier left in Afghanistan. “Have there been any actions? Any time, attention, or even mention from the Commander-in-Chief?” West wrote.

But this week, West was so unhappy that he said Obama ought to be impeached.

“Obama just released the leadership of a terrorist organization, and what did we get in return? A deserter, who by his own self-proclamation harbors anti-American sentiments,” West wrote.

The confused and bitter politics surrounding Bergdahl’s case also played a role in the cancellation of a rally in his home town of Hailey, Idaho. The event, planned for June 28, was designed to welcome him back.

Then the town’s police chief started getting calls from detractors. Police Chief Jeff Gunter said one lawyer called him with plans to bring 2,000 people for a protest.

“There’s no way we could handle that size of people,” said Gunter, whose force has 17 officers.

Is any other celebration of Bowe in the works? “Nothing’s been planned,” Gunter said.