Tehran (AFP) - The Iranian foreign minister's reported handshake with US President Barack Obama triggered chants of "Death to America" in Tehran's parliament Wednesday and a warning against "another kind of spying".

The foreign ministry has confirmed a "completely accidental" encounter between Obama and Foreign Minister Mohammad Javad Zarif on the sidelines of the UN General Assembly in New York on Monday, without denying there was a handshake as reported by Iran's semi-official ISNA news agency.

But hardline lawmakers went on the offensive against Zarif.

"With whose permission have they met Obama?" deputy Bahram Biranvand asked angrily. "Last time they talked to Obama on the phone and this time, with whose permission" did Iran's minister shake hands with the US leader?

Biranvand was referring to President Hassan Rouhani's historic telephone call with his American counterpart in 2013.

Zarif also came under indirect attack from Iran's ultraconservative judiciary spokesman, Gholamhossein Mohseni Ejeie, Fars news agency reported.

Without naming Zarif, Ejeie alluded to the Obama handshake and said: "Some spies are paid but there is another kind of spying that we have to watch out for. He prepares the ground for the enemy.

"These people would say: 'Why not allow a friendly handshake with the enemy? What's wrong with shaking hands with Obama? What's wrong with sitting with them, chatting away and drinking with them?'"

Despite the July 14 nuclear accord between Tehran and world powers led by the United States, Iran's supreme leader Ayatollah Ali Khamenei has said Washington remains Tehran's "number one enemy".

The Obama-Zarif handshake would be the first known between a US president and a top Iranian official since the two countries severed diplomatic ties in the wake of Iran's 1979 Islamic revolution.