Of the 545 days my colleague Jason Rezaian spent in an Iranian prison, perhaps the most unusual was the time his captors let him watch “The Shawshank Redemption” on Iranian state television.

The next day, a hulking man who was guarding Rezaian asked if he’d watched the film, in which the Tim Robbins character wrongfully imprisoned for 19 years escapes by digging a tunnel.

Rezaian, The Post’s Tehran bureau chief who was being held on bogus charges, said he had. “Isn’t it kind of weird that I’m able to see that in here?” Rezaian teased. “You know, it might give me some ideas.”

The jailor replied: “You can dig all you want. As far as you get in 20 years, you’ll still be inside this prison.”

Two weeks ago, Rezaian got out of that hellhole — not by digging but by dogged diplomacy, and a prisoner deal, negotiated by Secretary of State John F. Kerry. Rezaian stopped in Washington this week before returning home to California. He’s not yet doing interviews, but I had the pleasure of sitting down with him Thursday in his suite at the St. Regis — rather better surroundings than his cell in the notorious Evin Prison — to talk about his confinement.

A couple of hours earlier, he had taken the stage at the dedication of The Washington Post’s new headquarters, holding back tears as he spoke: “For much of the 18 months I was in prison, my Iranian interrogators told me that The Washington Post did not exist, that no one knew of my plight, and that the United States government would not lift a finger for my release. Today I’m here in this room with the very people who helped prove the Iranians wrong in so many ways.”

Among those was the secretary of state, who wept with joy when he met Rezaian for the first time backstage Thursday. Kerry said Rezaian’s release “was really one of the days that I enjoyed the most as secretary of state.” It was, indeed, one of Kerry’s finest hours. Though the White House demonstrated a maddening lack of urgency on Rezaian’s release, Kerry pursued the matter vigorously.

In prison, Rezaian saw Iranian reports of the nuclear talks and became hopeful he would be released as part of the deal. When he wasn’t, he hit rock bottom. He got a small boost when his mother, allowed a brief visit, told him how CBS News’s Major Garrett infuriated President Obama by asking why he was “content” to celebrate the nuclear deal without securing the release of Rezaian and others.

Rezaian arrived in Washington during a feel-good moment for The Post, when its glitzy new offices were christened. Owner Jeffrey P. Bezos (who gave Rezaian a ride back to the United States on his private jet) and editor Martin Baron (lionized in the movie “Spotlight”) have led The Post past all competitors, including the New York Times, in online readership. “I think The Post is just a little more swashbuckling,” Bezos said at the dedication. “There’s a little more swagger. There’s a tiny bit of badassness here at The Post.”

And now, after an 18-month campaign by the paper to keep Rezaian’s case in the public consciousness, his release has been deeply gratifying to his colleagues.

Rezaian recounted for me Thursday how he and his wife were taken from their home at gunpoint, blindfolded and handcuffed, and thrown into solitary confinement. He considered himself a prisoner at first, but his captors made clear he was a hostage, a bargaining chip.

He lost 45 pounds on prison food, largely a nasty flatbread, then regained some when he bargained for use of a hot plate and cooked what he called “prison chili” with ingredients he was allowed to buy. For a time, guards let him use an exercise bike and weights in their staff room. He never feared for his life, but he wondered if he would languish for years.

Since his release, he has reunited with family in Florida. He’s had sushi twice, and there was a bottle of Johnnie Walker Blue in his hotel suite. He turned on cable news to catch up on politics — and, aghast, turned it off. He’s heading home to Northern California, where he’ll play Legos with his nephew. He’s free in time to celebrate his 40th birthday and to catch his Oakland A’s in spring training.

Rezaian feels well but wonders whether confinement changed his outgoing personality. He doesn’t know what’s next (the man who cut his hair in Florida recognized him from TV news and advised him to find a fat book contract), but he knows he wants to tell the story of his captivity, to “make sure that it wasn’t in vain.”