Michel Abu Arraj, the chief judge in the investigation, made the request before a UN report expected to criticise the Lebanese government's handling of the inquiry is published.
He asked to quit because he is exhausted and because of the "atmosphere of scepticism surrounding the investigation", Justice Minister Adnan Addum said on Wednesday.
The minister, accused by the anti-Syrian opposition of allegedly helping in a cover-up, said he would immediately nominate a new magistrate to be approved by the Supreme Judicial Council, which is to meet on Thursday.
The investigation into al-Hariri's assassination is at the core of the political turmoil in Lebanon.
Last month, the government fell during a parliamentary debate on the assassination as 25,000 demonstrators called for an international inquiry.
The opposition has refused to join a new cabinet until the prime minister-designate agrees to hold an international investigation.
Opposition protesters accuse
Syria of getting al-Hariri killed
But the government has rejected calls for an international investigation, although it has cooperated with a UN fact-finding team.
A Lebanese newspaper owned by al-Hariri's family reported this week that the UN team has found the authorities prematurely removed the vehicles of his motorcade from the scene of the blast and cleared the site before sufficient forensic evidence was collected.
Al-Hariri was killed in a huge explosion that hit his motorcade in Beirut on 14 February.
The opposition has accused Syria and the pro-Syrian Lebanese government of killing him - a charge they deny. They also say Lebanese authorities are carrying out a half-hearted investigation in an attempt to hide the truth.
Al-Hariri's killing has greatly intensified the domestic and international campaign for Syria to withdraw its troops from Lebanon.
Al-Hariri's killing has widened
Lebanon's political divisions
It has prompted Damascus to bring home 4000 troops and redeploy its remaining 10,000 soldiers to eastern Lebanon, near the border.
The intensity of the political battle over Syria's troops in Lebanon has raised fears of a return to the sectarian violence of the 1975-90 civil war.
So far, however, the political factions do not conform to religious boundaries, with Christians and Muslims on both sides of the debate.