BEIRUT — Lebanese prime minister Saad Hariri resigned from his post Saturday during a trip to Saudi Arabia in a surprise move that plunged the country into uncertainty amid heightened regional tensions.

In a televised address from Riyadh, Hariri fired a vicious tirade against Iran and the Lebanese Hezbollah group for what he said was their meddling in Arab affairs and said “Iran’s arms in the region will be cut off.”

“The evil that Iran spreads in the region will backfire on it,” Hariri said, accusing Tehran of spreading chaos, strife and destruction throughout the region.

Hariri was appointed prime minister in late 2016 and headed a 30-member national unity cabinet that included the Shiite militant Hezbollah. The government has largely succeeded in protecting the country from the effects of the civil war in neighboring Syria.

The country is sharply divided along a camp loyal to Saudi Arabia, headed by the Sunni Muslim Hariri, and a camp loyal to Iran represented by Hezbollah.

Hariri’s resignation Saturday was expected to sharply raise tensions in the country. In his speech, he suggested he feared for his life and said the atmosphere in the country is similar to the one that existed before his father, the late prime minister Rafik Hariri, was assassinated in 2005.

Several Hezbollah members are being tried in absentia for the killing by a U.N.-backed tribunal in The Hague, Netherlands. Hezbollah denies any involvement.

He said Hezbollah’s policies have put Lebanon “in the eye of the storm.”

“Hezbollah was able in past decades to impose a status quo in Lebanon through its weapons directed at the chests of Syrians and Lebanese,” he said.

Earlier this week, Saudi State Minister for Gulf Affairs Thamer al-Sabhan sharply criticized Hezbollah, calling for its “toppling” and promising “astonishing developments” in the coming days during an interview with the Lebanese TV station MTV.

Al-Sabhan met with Hariri in Saudi Arabia when the now resigned prime minister was visiting first earlier this week. Hariri abruptly returned to the kingdom later Friday before his bombshell announcement Saturday.

In tweets after meeting Hariri, al-Sabhan described it as “long and fruitful meeting” that resulted in agreements over many issues that concern the Lebanese. “What comes is better, God willing,” al-

Sabhan tweeted on Tuesday. In a series of tweets, al-Sabhan criticized the Lebanese government for tolerating Hezbollah’s criticism of the kingdom.

He earlier said that those who cooperate with Hezbollah must be “punished.”

The attacks on Hezbollah came on the heels of new U.S. sanctions on the group.