"The people of Yemen will make their aggressors regret their actions," Rouhani said in a televised speech.
His comments came a day after the killing of ex-president Ali Abdullah Saleh by Iran-backed Huthi rebels triggered a renewed Saudi-backed offensive on the Yemeni capital Sanaa.
The commander of Iran's elite Revolutionary Guards, Mohammad Ali Jafari, said Saleh was killed because he had been trying to overthrow the Huthis.
Saleh had recently broken his uneasy three-year-old alliance with the Huthis and said he was open to talks with the Saudis.
Also Read
Saudi Arabia, Iran's main regional rival, has been leading a coalition against the Huthis in a war that has cost thousands of lives and become the world's worst humanitarian crisis according to the United Nations.
Tehran denies direct military support for the Huthis, but a recent UN report said a missile fired by the rebels into Saudi Arabia appeared to have been designed and built in Iran.
"Some Islamic countries have shamelessly revealed their closeness to the Zionist regime," Rouhani said.
"If some of these countries in the previous years were engaged in negotiations, interaction and cooperation in secret with the enemies of Islam in the region, at least they would deny it in public. Such relations were considered ugly, detestable, sinister and indecent.
"I have no doubt that the Muslims of the world will not let this sinister plot bear fruit," Rouhani added.
Lieutenant General Gadi Eisenkot added that the Jewish state was "ready to exchange experience with the moderate Arab countries and exchange intelligence information to face Iran."
The Saudis have not publicly responded to the reports, and analysts say there is still little chance of formal diplomatic recognition between the two countries.
Disclaimer: No Business Standard Journalist was involved in creation of this content