BEIRUT, Lebanon — Prime Minister Saad Hariri of Lebanon said on Saturday that he had quit his post, blaming Iran for interference in Arab affairs and throwing his country, already awash with tensions and regional rivalries, into deeper uncertainty.

Mr. Hariri, speaking in a televised address from the Saudi capital, Riyadh, issued a blistering condemnation of Iran and its growing power and influence in the region. He also assailed Iran’s Lebanese ally, Hezbollah, the Shiite militia and political party that is part of the national unity cabinet he led.

“Wherever Iran settles, it sows discord, devastation and destruction, proven by its interference in the internal affairs of Arab countries,” Mr. Hariri said, adding that Iran’s “hands” in the region “will be cut off.”

The surprise announcement — which shocked even his own staff — was an ominous sign of the escalating regional rivalry between Saudi Arabia and Iran, analysts said, indicating the growing dominance of Iran and Hezbollah as well as the Saudis’ increasingly assertive response.