"I have ... submitted the resignation of the government, and I have declared that I will not be a candidate to head the [next] government," he said in a statement on Wednesday, blaming internal political differences for his decision.
Al-Hariri, 59, a Sunni Muslim who has been prime minister for most of the past 12 years, had first announced early last month that he planned to resign amid a political crisis over Syria's influence in Lebanese affairs.
The departure of the business tycoon, long regarded as a canny political player with close ties to Western leaders and financial creditors, also cast a cloud over the economic health of the country which is $32 billion in debt.
A presidential statement said Hariri submitted his resignation to President Emile Lahud, his main political rival who is favoured by Lebanon's political masters in Damascus.
"Al-Hariri submitted his resignation which was accepted by President Lahud who asked the current government to stay on as caretaker cabinet," it said.
Lahud, whose term in office was controversially extended by three years under a Syrian-inspired constitutional amendment, will on Thursday start parliamentary consultations which are compulsory to name a new prime minister, officials said.
President Emile Lahud is
al-Hariri's main political rival
Observers fear a threatened boycott of the consultations will give Lahud a free hand to appoint a pro-Syrian figure as prime minister.
Al-Hariri's move comes amid a deadlock between Syrian President Bashar al-Asad's government in Damascus and the United Nations.
On Tuesday, the UN repeated a call for Syria to pull its troops out of Lebanon - a demand that Damascus swiftly rejected.
Al-Hariri's statement said internal political differences were behind his decision, although it is too early to say whether his resignation means the end of the tycoon's colourful political career.
"Facing the challenges, any challenges, can only be done through a unified domestic front that meets the goals of the Lebanese people ... but these objectives have been confronted by known political realities," saial-Hariri.
Rafiq al-Hariri was first named prime minister at the relatively young age of 48 in 1992 when Lebanon was desperately seeking a saviour to help the country emerge from the massive destruction inflicted by the 1975-1990 civil war.
"Facing the challenges, any challenges, can only be done through a unified domestic front that meets the goals of the Lebanese people ... but these objectives have been confronted by known political realities"
Statement by Rafial-Hariri
Since then, the man credited by his admirers as the architect of the country's post-civil war reconstruction and by his detractors as a spendthrift, has headed five governments.
The fate of al-Hariri, who built his empire in Saudi Arabia and has business interests extending from construction to the media, had been uncertain for weeks, with no clear indication if he would resign to form a new government or leave office altogether.
Most of the 29 MPs who voted in the 128-member parliament against the 3 September amendment that extended Lahud's term have previously declared they would not participate in consultations to choose a new government.
They include the blocs of prominent Druze leader Walid Jumblatt and the Christian gathering of Qornet Shehwan which have been calling for an end to Syrian interference.
The crisis was further aggravated with the resignation of four government members, including a close Jumblatt aide who was injured in a failed assassination bid on 1 October, over the extension of Lahud's term.
Syria's 16,000 troops are at the
centre of a diplomatic dispute
Syria is believed to have about 16,000 troops in Lebanon, what is left of a much larger force sent in during Lebanon's civil strife.
Both Beirut and Damascus insist the troops are there by mutual agreement.