"I announce my resignation from the post of prime minister," he said in a speech broadcast from Saudi Arabia by the Al-Arabiya news network.
"I felt what was being covertly plotted to target my life," Hariri said.
The two-time prime minister, whose father Rafik held the same position for years and was assassinated in 2005, accused Iran and its powerful Lebanese Shiite ally Hezbollah of seeking hegemony in the region.
The 47-year-old Sunni politician's resignation comes less than a year after his government, to which Hezbollah's political wing belongs, was formed.
More From This Section
"In recent years, Hezbollah has used the power of its weapons to impose a fait accompli," he said, reading a speech from behind a desk.
Hariri accused Tehran of "sowing discord among the children of the same nation and creating a state within the state... to the extent that it gets the final say on how Lebanon's affairs are run."
Hezbollah is a vital ally of Syrian President Bashar al- Assad in the war the Syrian regime is waging against the Islamic State group and armed opposition movements.
Its arsenal has since grown exponentially and now outstrips that of the nation's own armed forces.
It claims it is the only credible rampart against neighbouring Israel and its refusal to disarm is the main political crux in Lebanon.
Hezbollah members have been accused over the 2005 assassination in a massive car bomb blast of Rafik Hariri, the dominant figure of Lebanon's post-war political landscape.
He made his fortune in Saudi Arabia, where his son Saad was born. Riyadh is Iran's main regional rival and the two powers' tussle for influence has played out in ongoing conflicts in Iraq, Syria and Yemen.
"President Aoun is waiting for Hariri's return to Beirut to enquire about the circumstances of his decision and decide on the next steps," a statement said.
Hariri said in his speech that the political climate in Lebanon was reminiscent of that which prevailed before his father was killed.
The February 2005 assassination triggered political upheaval that led to Syria's military withdrawal from Lebanon.
Walid Jumblatt, one of Lebanon's political heavyweights and the country's most prominent Druze leader, said Hariri's resignation could adversely affect a country already under huge strain.
"Lebanon is too small and vulnerable to bear the economic and political burden that comes with this resignation," he said on social media. "I will continue to call for dialogue between Saudi Arabia and Iran.