Washington Post journalist Jason Rezaian asked a federal judge Tuesday to impose $1 billion in damages against the government of Iran to deter future taking of American hostages, saying his ordeal began when one of three Iranian security agents pointed a gun at his head in the parking garage of his Tehran apartment building at about 8 p.m. on July 22, 2014.

“Are you Jason Rezaian?” the gunman asked.

When he answered yes, the security officials forced their way on to the elevator carrying Rezaian and his wife, Yeganeh Salehi, who were heading to her mother’s birthday party, Rezaian testified Tuesday in federal court in Washington, D.C.

Over the next 18 months, Rezaian and family members said on the witness stand, the recently wed couple were arrested; placed separately in solitary confinement; and threatened with execution, physical mutilation and dismemberment.

In Rezaian’s case, he testified, he also was convicted of espionage after a “sham trial” with no witnesses, and evidence that consisted of his newspaper articles and an earlier unsuccessful application for a U.S. government job.

He was held 544 days in captivity, and his wife spent 72 days in solitary confinement.

Rezaian, 42, his brother Ali, and their mother, Mary, gave new details of the family’s ordeal in a lawsuit asking U.S. District Judge Richard J. Leon to award $44 million in compensatory and economic damages and $1 billion in punitive damages.

Rezaian attorney David Bowker said the amount was warranted to force Iranian authorities “to recalculate the costs and benefits” of using hostages and terrorism as tools of diplomatic leverage.

Rezaian was held as a bargaining chip, and he and his family were “irreparably injured” for the express purpose “of trading him for concessions by the United States” in multinational talks leading to a historic agreement limiting Iran’s nuclear program, Bowker said.

Rezaian was released with two other Americans in a prisoner swap completed Jan. 16, 2016, the day the nuclear pact was implemented. In exchange, seven Iranians charged or imprisoned on sanctions violations won U.S. grants of clemency.

The Rezaian family’s lawsuit cited statements by Brig. Gen. Mohammad Reza Naqdi, the commander of Iran’s Basij Force, an internal paramilitary security force, linking Rezaian’s release to the U.S. payment of roughly $1.7 billion to Iran in the nuclear deal, comprising frozen Iranian deposits and interest accrued on money held for U.S. arms purchases that were interrupted after Iran’s 1979 takeover of the U.S. Embassy in Tehran.

Similar statements were made by Iran’s culture minister and by a hard-line member of parliament.

“It’s still confusing,” Rezaian said in federal court. “It’s still hard to believe how and why this all happened to us.”

“It sounds like it’s 98 percent symbolic,” Leon said of the Rezaians’ damages claim, before asking whether they thought they could claw back a portion of the $1.7 billion released in 2016.

Bowker said such a solution “seems sensible” but poses a political question “beyond our reach.”

“We went into this with our eyes open . . . knowing we might not see a penny,” Bowker said, but he said that a billion-dollar judgment would spur other law firms with past success at hunting down foreign assets to attempt “to change the calculus” for state sponsors of terrorism.

The lawsuit was brought under a “terrorism exception” to the Foreign Sovereign Immunities Act, a law that generally bars U.S. citizens from suing foreign governments in domestic courts except for circumstances including cases of terrorist acts, torture or hostage-taking by nations designated by the State Department as state sponsors of terrorism.

The Rezaian lawsuit lists as co-defendants the Islamic Republic of Iran and the hard-line Revolutionary Guard Corps.

Iran’s permanent mission to the United Nations in New York did not respond to requests for comment on the Rezaian court case.

Rezaian was eventually tried and convicted on espionage and related charges, according to Iranian state media accounts, although the government did not officially disclose specifics of his trial or sentence. The family’s lawsuit links key moments in the nuclear negotiations to Rezaian’s movements through the Iranian judicial system.

Rezaian testified of physical and mental injuries he sustained as well as damage to the career he believed he was born for since growing up as the American-born and Farsi-speaking son of an Iranian father who emigrated to the United States in 1959 and became a successful Persian rug dealer in the San Francisco Bay area.

Rezaian was The Post’s correspondent in Tehran from 2012 to 2016 and is now a writer for its Global Opinions section.

Rezaian said he was held in isolation for 49 days in an eight-foot by four-foot concrete cell, fitted only with a sink and a hole in the floor that were breeding grounds for cockroaches and other insects.

The cell was lit 24 hours a day in the stifling Tehran summer heat, and Rezaian was allowed to leave only for interrogations, which he estimated occurred on 45 days, usually multiple times daily. He testified that he lost 40 pounds and suffered digestive and pulmonary ailments, as well as infections to his eyes and other parts of his body.

Rezaian said he was repeatedly subjected to psychological and physical abuse that included threats of beheading and life imprisonment, and was forced to sign a statement addressed to Iran’s supreme leader admitting “mistakes,” give interviews to Iran’s state television, and to make a false confession that his acts of journalism amounted to spying.

Rezaian, his wife and his brother each contemplated suicide, and each of the plaintiffs seeks damages for emotional suffering, including trauma and guilt, according to the suit.

The family continues to live under continual harassment and targeting by Iranian agents, they have said.

To get Rezaian to confess, interrogators threatened him with beheading, and said a video confession was his only way out.

“Jason’s life today is improving, and Jason is working very hard to make it better, but it is not the life he chose. It is the life of a former hostage,” Bowker said.