Venezuela’s President Nicolás Maduro, left, and Iran’s President Hassan Rouhani speak during a meeting Monday at the U.N. General Assembly. (Handout/Reuters)

President Obama exchanged a handshake with Iran’s top diplomat at the United Nations, a U.S. official said Tuesday, in a small but closely watched gesture as the two countries move ahead with a nuclear accord.

Iran’s foreign minister, Mohammad Javad Zarif, is well known to Secretary of State John F. Kerry and other U.S. envoys following the long negotiations over the deal to limit Iran’s nuclear program in exchange for easing international sanctions.

But the handshake breaks new ground: the first between a U.S. president and Iran’s foreign minister since the 1979 Islamic revolution and the hostage-taking at the U.S. Embassy in Tehran that followed.

A senior Obama administration official said the president and Zarif shook hands during a “chance encounter” at a luncheon Monday during the U.N. General Assembly in New York. The official spoke on the condition of anonymity to discuss a private exchange.

“The interaction was brief,” the official said, “lasting less than a minute.”

Iran’s official Islamic Republic News Agency quoted a diplomatic official as saying Zarif encountered Obama “accidentally” and they shook hands. The report gave no other details.

It’s not the first surprise U.S.-Iranian contact at the annual U.N. gathering of world leaders.

In 2013, Obama held a phone conversation with Iranian President Hassan Rouhani just months after his election — the first direct discussions between U.S. and Iranian presidents since diplomatic ties were broken.

On Monday, Rouhani took aim at the United States in his U.N. address — claiming that Washington provides terrorists and other militants with a “justification” because of American military intervention in Iraq and Afghanistan and strong U.S. backing for Israel.

Earlier, Rouhani vowed to work for the release of three Americans imprisoned in Iran — including Washington Post correspondent Jason Rezaian — if the United States takes steps to free Iranians held in American custody.

Read more:

Today’s coverage from Post correspondents around the world