President Obama shook hands with Iranian Foreign Minister Mohammad Javad Zarif on Monday at the United Nations General Assembly, according to an administration official.

ADVERTISEMENT

The handshake was the highest-level encounter between U.S. and Iranian officials in three decades. It capped off the landmark nuclear deal reached in July that some administration officials hope will reduce tensions with Tehran.

An administration official described the handshake as "brief" and said it occurred during a luncheon for world leaders at the United Nations headquarters in New York. The official said it was a chance encounter and not pre-planned.

Speculation was rampant before the summit that Obama would meet with Iranian President Hassan Rouhani, but U.S. officials said no meeting was planned and Rouhani cut his trip short to return to Tehran Monday.

Will cut NY trip short & leave for Tehran tomorrow after #UNGA speech to receive bodies from the tragic #MinaStampede pic.twitter.com/2DGDel3Fpw — Hassan Rouhani (@HassanRouhani) September 28, 2015

The U.S. and Iran have not had formal diplomatic relations since its 1979 Islamic revolution. But contact between the two sides has increased in recent years in pursuit of a nuclear deal.

Obama spoke on the phone with Rouhani after his election in 2013, and Zarif was Tehran's chief nuclear negotiator, spending months in talks with Secretary of State John Kerry John Forbes KerryThe Memo: Warning signs flash for Trump on debates Divided country, divided church TV ads favored Biden 2-1 in past month MORE and other top diplomats.

In his speech, Obama praised the nuclear deal as an example of how diplomacy, and not war, can be used to accomplish foreign policy goals, but he also chastised Iran for fueling instability in the Middle East through funding terrorist groups and fighting proxy wars in places such as Yemen and Syria.

"Chanting 'Death to America' does not create jobs or make Iran more secure," Obama said. "If Iran chose a different path, that would be good for the security of the region, good for the Iranian people and good for the world."

Rouhani hailed the nuclear agreement as the beginning of a "new era" for peace in the region, but he also blamed the U.S. intervention in the Middle East for the rise of terrorist violence.

"If we did not have the U.S. military invasion of Afghanistan and Iraq and the United States's unwarranted support for the inhumane actions of the Zionist regime against the oppressed nation of Palestine, today the terrorists would not have an excuse for the justification of the crime," he said.