When news broke today that Washington Post reporter Jason Rezaian would be freed from his longstanding imprisonment from Iran, it came as a welcome surprise to many reporters. But not, apparently, to some journalists at The Huffington Post, CNN, The Washington Post and The Wall Street Journal.

Several of America's biggest and most influential outlets were aware the United States was attempting to orchestrate a prisoner exchange with Iran and kept the details quiet at the request of the State Department so as not to jeopardize a swap that might lead to the release of Rezaian and three other Americans.

News of the media blackout was first disclosed by The Huffington Post Saturday in a story by Washington Bureau Chief Ryan Grim.

The Huffington Post first received word of the pending exchange from Chase Foster, a former foreign affairs officer at the U.S. State Department, according to Grim. Foster was willing to go on the record about the sensitive matter — an extreme rarity in diplomatic-journalistic relations — but HuffPost held the news so as not to upend the negotiations. They weren't alone, as Grim notes:

When we reached out to the administration, the frontline press folks there were extremely aggressive and served up a bunch of garbage we later confirmed to be garbage. But when we approached administration officials higher up the chain, they told us what was actually happening. They told us that reporters for The Washington Post and The Wall Street Journal were withholding details of the talks as well, though neither knew of Foster, whose identity we never revealed to the government. They did not put hard pressure on us to hold our story, but instead calmly laid out their analysis of the possible consequences of publishing, and offered confidence that the talks were moving forward and headed toward a resolution. Several times over the course of the past few weeks, it looked like a deal could be struck any moment, but it wouldn't come together and timing would be pushed forward.

CNN confirmed Saturday that it also participated in the media blackout at the State Department's request to avoid jeopardizing the prisoner swap.

"CNN was among the news organizations that have been aware of the ongoing negotiations about the prisoners release from Iran," a CNN spokesperson told Poynter. "Like all of our colleagues in the media who were aware of these developments, we did not report on this information in order to avoid any possibility of interfering in the negotiations."

A spokesperson for The New York Times said the newspaper did not participate in the blackout. A spokesperson for The Washington Post declined to comment for this story. A spokesperson for The Wall Street Journal declined to comment for this story.

As word of the prisoner exchange begin circulating throughout Washington, D.C. Saturday, at least one other news outlet became aware of the situation. An Associated Press reporter was going to insert the news into the pool report but was pressured by State Department officials not to do so; his editors in the U.S. acceded to the State Department's request, according to Grim.

Ultimately, Grim wrote, the risks presented by publishing the story outweighed the benefits of being first with a huge scoop.

"So we held the story, and are writing this one instead," Grim wrote. "We're glad we did."

Media blackouts are not unprecedented in cases where the life and freedom of journalists are at stake. When NBC correspondent Richard Engel was kidnapped in 2012, the network was successful in repressing the news until he was released. The New York Times enforced a blackout about the capture of correspondent David Rohde in 2008 until he escaped months later.

Rohde, who now works as an investigative reporter at Reuters, told Poynter that news organizations must consider every request for a media blackout on a case-by-case basis. In situations where they have credible indicators that divulging information could imperil an individual, Rohde thinks avoiding disclosure is the right thing to do.

"If the question is do you report a story and endanger a life or prolong an imprisonment — I think it should be rare — but I think in some cases it’s appropriate to withhold information," Rohde said.

A number of factors determine whether a news organization should adhere to a blackout request, said Joel Simon, executive director of the Committee to Protect Journalists. There are some cases where withholding the information might lead to a state of ignorance that puts additional lives at risk — as it did when the media decided not to report on a spate of kidnappings in Syria in recent years. By not reporting on the abductions, news organizations clouded the extent of the problem in the country, Simon says.

But today's prisoner swap was not such a case, Simon said. Rezaian's imprisonment was very well-publicized already. In addition, reporters had credible information from a reputable source that their silence could help secure Rezaian's freedom.

"The dynamic here was very different," Simon said. "I think it was compelling evidence that making this public would have compromised the negotiations. I think it’s quite credible to assert that the negotiations would have collapsed if this was made public."

Today's exchange was foreshadowed publicly by several observers months in advance of today's announcement. Experts speculated that Rezaian and his fellow prisoners were intended as bargaining chips in a possible prisoner swap amid political infighting among Iranian power brokers.