Jason Rezaian in November 2013. (Zoeann Murphy/The Washington Post)

THE ANNOUNCED implementation of the Iranian nuclear deal on Saturday came with an important bonus: Tehran’s release of four U.S. citizens it had imprisoned, including The Post’s Jason Rezaian. The Americans were exchanged for seven people charged or convicted of crimes in the United States, and the dropping of U.S. cases against 14 others whose arrest was sought. Mr. Rezaian, who was held for 544 days, committed no crime and should have never been arrested. He was not a convict but a political hostage. His freeing and that of the other Americans ends a gross injustice.

When Mr. Rezaian, a 39-year-old dual Iranian and U.S. citizen born and raised in California, was seized in his home with his Iranian wife, Yeganeh Salehi, on July 22, 2014, Iran had recently extended an interim agreement on its nuclear program with the United States. As the nuclear negotiations continued, Mr. Rezaian languished in Tehran’s notorious Evin P rison. Judicial authorities repeatedly violated Iran’s own laws by, among other things, holding the Post reporter for months — often in solitary confinement — before bringing charges, allowing him almost no pretrial contact with his defense lawyer, failing to inform him or his lawyer of the verdict or sentence after completion of a sham trial in August, and ignoring a deadline for release in the absence of a public conviction.

Judicial authorities were adept, however, at making announcements or staging hearings during sensitive periods of the nuclear negotiations. One hearing was held the day before the completion of the final pact on July 14. Officials issued contradictory statements about the journalist’s status, sometimes declaring he had been convicted and sentenced on espionage charges and at other times saying the case was still open. The most honest explanation of his imprisonment came in media accounts that accused him of conspiring to improve relations between the United States and Iran, something that Supreme Leader Ali Khamenei has sworn to prevent.

Mr. Rezaian’s release, and that of fellow Americans Amir Hekmati, Saeed Abedini and Nosratollah Khosravi-Roodsari, is unlikely to alter that policy or Iran’s transgressions of international law. The International Atomic Energy Agency certified Saturday that Iran had complied with the initial requirements of the nuclear deal, including shipping 25,000 pounds of enriched uranium out of the country and putting thousands of centrifuges into storage. That allowed the government of Hassan Rouhani to gain access to tens of billions of dollars in frozen assets as well as the lifting of sanctions on the country’s banks and oil industry in advance of parliamentary elections next month.

Since the accord was signed, however, Iran has twice violated a separate U.N. Security Council resolution prohibiting testing of long-range missiles. It continues to hold at least one American, businessman Siamak Namazi; another, former FBI agent Robert Levinson, remains missing. (Tehran separately released a detained American student Saturday). Possibly because of its interest in completing the prisoner swap, the Obama administration’s response has been weak: It withdrew the modest sanctions it had prepared in response to the missile launches.

The Post and Mr. Rezaian’s family will celebrate his safe return and that of the other Americans. But in the absence of a firmer U.S. policy, Iran’s attacks on Americans and vital U.S. interests will surely continue.