The last time that Jason Rezaian felt freedom, which Iranian state media today announced will finally be restored, was in July 2014. He spent most of that month as he had many months before it, living and reporting in Iran, where one of his parents was born and where he holds citizenship, along with a US passport. He reported, as a writer for the Washington Post, on stories that humanized Iran and the often-vilified people who live there, as well as on the nascent signs of an opening between the US and Iran for which Jason was hopeful.

Jason also spent that month settling into matrimonial life: He had recently married Yeganeh Salehi, also a Tehran-based journalist, writing for an Abu Dhabi newspaper called the National.

In what little spare time remained, he dedicated himself, as he always had, to what he saw as the overlapping missions of offering hospitality to friends and guests and of cultivating mutual understanding between Americans and Iranians. In June, he and Yeganeh hosted Anthony Bourdain, along with his substantial CNN crew, for a televised tour of Iran's food and, gingerly, its politics.

And he spoke to fellow reporters, encouraging them to visit Iran, including, that July, me. As we hopped between dropped Skype calls and staticky landlines — Jason preferred the former to avoid government monitors — he persuaded me to visit that fall, provided me with the necessary contacts to get started on a visa, and, of course, offered his home. He also, uncharacteristically, asked for a favor: Yeganeh would be in Washington later that summer for a few weeks and was looking for an internship.

This was the life and work that, on July 22, Iranian state security forces brought crashing down when they stormed Jason and Yeganeh's Tehran apartment and imprisoned them both on what would later be revealed as patently absurd espionage charges.

Yeganeh was released that October, but Jason spent more than 500 days locked up in Iran's infamous Evin Prison, kept in solitary confinement in a cell with no mattress or toilet, deprived of necessary medication as his health deteriorated and as the world called, again and again, for his release. He was occasionally dragged before courts with little pretense of fairness or openness — Iran's judiciary often seems to believe the good times of 1979's revolutionary show trials never ended — as his family pleaded for access they rarely won.

Today, on Saturday, Iran announced it has freed Jason, along with three other American citizens it had held: Amir Hekmati, Saeed Abedini, and an unnamed fourth, reportedly in exchange for six Iranian Americans held in the United States. While Jason is not yet home, it appears that he will be soon, and that the long ordeal that often appeared it would never end finally will.

The story of Jason's arrest and 18-month detention is, for those who know him, a personal story, but it is also an inescapably political story. No one can say for sure why Iran chose to arrest him and his wife, but the consensus among most Iran watchers is that this was probably an effort by Iran's hard-liners to sabotage the ongoing nuclear negotiations with the United States and other world powers, or at least to exert some influence over them.

Iran's hard-liners, who opposed the nuclear talks they feared were a dishonest American ploy, wield tremendous power in Iran, particularly over certain institutions such as security forces and parts of the judiciary, but they are not all-powerful. Since 2013, when Iranians elected the moderate Hassan Rouhani as president, Iran's moderates have gained in power, and the two have pushed and pulled one another ever since.

If this theory is to be believed, then Jason's arrest had the desired effect in the United States, embarrassing the Obama administration and strengthening those who argued Tehran could never be trusted. If Iran's so-called moderates could not even free Jason, many in the US asked, how could they convince Iran's supreme leader to dismantle the bulk of his nuclear program?

In July 2015, nearly a year to the day after Jason's arrest, Iran and the world powers announced they'd reached a nuclear agreement. Many of Jason's friends saw hope for his release: If there were no more negotiations to undermine, then Iran's hard-liners had no more reason to keep him.

But the weeks and then months ticked by, and nothing happened. As Jason reached his 500th day in detention, his colleagues at the Washington Post, worried and frustrated, helped to maintain attention on the case as best they could. They did not want Jason to be forgotten, nor did they want him to become just another partisan cudgel in the increasingly political fight over the nuclear agreement, which had quickly become, in Washington, a referendum on the Obama administration's larger policy of tenuous outreach to Iran.

The nuclear deal, meanwhile, chugged forward. Iran surrendered the bulk of its uranium just after Christmas, thus dismantling much of its nuclear program. It submitted to new inspections and began disassembling its plutonium facility.

Today, on Saturday, Iranian Foreign Minister Javad Zarif met in Vienna with US Secretary of State John Kerry to formally mark what is known, in the odd language of arms control agreements, as "Implementation Day," the day that the agreement formally begins and that, most significantly, the world lifts many of the sanctions that have devastated Iran's economy.

Lifting sanctions was always the prize for Iran. Securing their end was, in many ways, not just the promise that America made to Iran, but also the one Iran's moderates made to the hard-liners: Stick with us and we will release the world's grasp on our economy.

Seemingly moments after the US and Iran formally marked Implementation Day, Iranian state media announced that Jason and the three others would be released in exchange for Iranian Americans held in the US.

The exact connection between the nuclear deal and this release is not known, and it may not be for some time. Had Iran's hard-liners quietly pledged not to release the prisoners until the sanctions lifted, keeping them as bargaining chips against the US they see as innately distrustful? Were Iran's moderates in on this too? Or rather, perhaps, had they been on the other side of it, cajoling and persuading the hard-liners with whom they're often at odds to finally let the prisoners free?

Or, in another theory, had the US and Iran negotiated the prisoner swap all along as a secret component of the nuclear deal? Did Iran insist from the start that the Americans wouldn't go home until sanctions lifted? Did the US declare that sanctions wouldn't lift until Jason and the others were freed?

And what's the lesson here? Does this all go to show that diplomacy can strengthen Iran's moderates against the hard-liners, inching a long-dangerous rogue state away from its bad behavior, or is it just another reminder that this is and always will be a country that imprisons journalists as bargaining chips?

You will see, in the coming hours and days, many American analysts and pundits and politicians assert one or another of these theories as indisputable fact. As with every twist and turn of the experiment in Iran-US opening that began nearly three years ago — an experiment that Jason chronicled exhaustively, and about which he was cautiously hopeful — this moment will be used by those in the US who wish to push one agenda or another, or who wish to paint it as a victory or humiliation for the Obama administration.

I am tempted to dismiss this debate, for all its callousness and its false certainties and its exploitation of Jason as a political tool. But at the same time, I know that this is all part of the larger story that Jason saw, in his freedom, as so important to cover. I am today hopeful, in a way that I have not been for some time, that his voice will be back with us, in whatever capacity, quite soon.