Kerry said the release of the prisoners followed months of meetings with Zarif and between other senior USA officials and Iranian officials on the sidelines of nuclear talks, which began in earnest in 2013.
A fifth American, identified as Matthew Trevitick, was also to be released as part of a different process, according to a USA official.
A plane carrying a group of U.S. nationals detained by Iran has now departed Tehran, the U.S. Department of State said Sunday.
"We couldn't be happier to hear the news that Jason Rezaian has been released from Evin Prison", Frederick J. Ryan, Jr., publisher of The Washington Post, said in a statement. They spoke about the prisoner exchange on condition of anonymity because they were not authorized to discuss it publicly.
KELEMEN: And, you know, also with the release of these prisoners it shows that the Iranian moderates do want to put a different face of Iran out to the world today. Rand Paul saying he was pleased "our government did not sit idly by" as Iran held pastor Saeed Abedini, who was among those freed. He's American. He was a researcher based in Turkey, and his family says he went to Iran last September for language training.
The seven Iranians freed by the U.S. are Nader Modanlou, Baharam Mechanic, Khosrow Afghahi, Arash Ghahreman, Tooraj Faridi, Nima Golestaneh, and Ali Saboonchi, according to IRNA and the state broadcaster.
But not all news was good for Tehran: The U.S. on Sunday imposed new sanctions against 11 individuals and entities involved in Iran's ballistic missile program as a result of Tehran's firing of a medium-range ballistic missile in October.
Republican presidential candidates had slammed the Obama administration for striking the multinational nuclear deal with Iran while Americans were held captive.
California-born Rezaian was detained in July 2014 and later convicted after a trial on charges of espionage and other crimes against national security.
"I am overcome with emotion that after four and a half years, this awful ordeal is ending and the Hekmati family will soon be reunited with Amir", Kildee said. They won't be on US soil for a few days, he said. But Iran said he had taken off, too.
Six of the seven are dual citizens.
He said family members were feeling "tampered jubilation" Saturday while they waited to find out if Hekmati was really released, because they've gotten their hopes up in the past.
U.S. Secretary of State John Kerry will join Federica Mogherini of the European Union and Iranian Foreign Minister Mohammad Javad Zarif in Vienna, the headquarters of the UN's International Atomic Energy Agency, later Saturday. The U.S. also removed Interpol red notices and dismissed charges against 14 Iranians for whom extradition was unlikely to be successful.