In a televised address from Riyadh on Saturday night, Hariri said he feared an assassination plot and accused Iran of meddling in the region, causing "devastation and chaos", reports CNN.
"Iran controls the region and the decision-making in both Syria and Iraq," he said.
"I want to tell Iran and its followers that it will lose in its interventions in the internal affairs of Arab countries."
In response, Tehran dismissed the reports, accusing the US and Saudi Arabia of orchestrating the resignation.
"Hariri's resignation was coordinated with US President Donald Trump and Saudi Arabia's Mohammad bin Salman," Iranian Foreign Ministry official Hossein Sheikholeslam told the Fars News Agency.
"The resignation was aimed at creating tension in Lebanon and the region. This resignation was also meant to compensate the US for its failures after the defeat of the IS (Islamic State)."
In his speech, Hariri, a Sunni politician, also pointed to Hezbollah, the powerful Iranian-backed Shia militant group in Lebanon, CNN reported.
"Over the past decades, Hezbollah has unfortunately managed to impose a fait accompli in Lebanon by the force of its weapons, which it alleges is a resistance weapon,.
"Lebanon and the great Lebanese people became in the eye of the storm and subjected to international condemnations and economic sanctions because of Iran and its arm Hezbollah," he said.
While the US considers Hezbollah a terrorist group, its political wing is the most powerful bloc in Lebanon's divided coalition government, and several of its politicians are ministers.
Lebanese President Michel Aoun, a Christian who is affiliated with Hezbollah, confirmed he had received a phone call from Hariri about stepping down.
Aoun's office said he would wait for the Prime Minister to return to Beirut to discuss the circumstances of his resignation.
Hariri added that the present atmosphere in Lebanon was similar to the one that existed 12 years ago right before the assassination of his father, former Prime Minister Rafik Hariri.
"We live in an atmosphere similar to the atmosphere that prevailed before the assassination of martyr Prime Minister Rafik Hariri, and I sensed what is being woven in secret to target my life," he said.
Rafik Hariri was assassinated in February 2005 when a bomb struck his motorcade near the Beirut seafront.
President Aoun asked Hariri to become Prime Minister last year. He headed a national unity Cabinet that included Hezbollah, CNN reported.
It marked Hariri's second stint as Prime Minister. He first took office in June 2009. Less than two years later, 11 Hezbollah members of his Cabinet resigned, causing a coalition government to collapse.
Under the Lebanese Constitution, the president must be a Maronite Christian, the prime minister a Sunni and the speaker of the Parliament a Shia Muslim.
- - - - - - - - - Advertisement- - - - - - - - -