Tehran mayor withdraws from Iran election, backs hardliner Raisi
Ghalibaf called on his supporters to back conservative cleric and jurist Ebrahim Raisi in Friday's vote, saying it was vital for the "preservation of the interests of the people, the revolution and the country".
"I ask all my supporters to contribute their full capacity and support for the success of my brother, Ebrahim Raisi," Ghalibaf said in a statement announcing his withdrawal.
"A fundamental and crucial decision must be taken for the unity of the revolutionary front," he added.
Ghalibaf's decision brings the number of candidates competing in Friday's election to five, though more may drop out in the coming days to solidify support for other candidates.
This election marked Ghalibaf's third presidential campaign, having previously lost running to the left of hard-line President Mahmoud Ahmadinejad in 2005 and to the right of Rouhani in 2013.
Unofficial polls still show Rouhani, a moderate cleric who has sought to improve civil liberties and rebuild ties with the West, as the front-runner.
But he has faced a harder-than-expected challenge from the conservatives due to the continued stagnation of the economy.
Raisi, a former prosecutor-general and close ally of supreme leader Ayatollah Ali Khamenei, has called for a more assertive approach to the West and a focus on building a self-sufficient "resistance economy".
Ghalibaf's dropping out may serve to get him more votes in his challenge to Rouhani. Some also have speculated that Ghalibaf could serve as a vice president in Raisi's administration, in exchange for his support.
The election is largely viewed as a referendum on the 2015 nuclear deal struck with world powers shepherded by Rouhani's administration. That deal saw Iran limit its enrichment of uranium in exchange for the lifting of some economic sanctions.
Rouhani remains the favourite as every Iranian president since 1981, when Khamenei himself took the presidency, has won re-election.
However, most Iranians have yet to see the benefits of the nuclear deal. Raisi has been campaigning on that, proposing populist cash payments for the poor that have proven popular in the country in the past under Ahmadinejad.
Raisi already has the support of two major clerical bodies that declined to endorse anyone in the last presidential election, snubbing Rouhani, who himself is a cleric.
However, Raisi's candidacy also has revived the controversy surrounding Iran's mass execution of thousands of prisoners in 1988, one of the darkest moments of the country's history since the 1979 Islamic Revolution and one still not acknowledged by its authorities.
Raisi allegedly served on a board that sentenced some of the prisoners to death, something he has not discussed during his campaign, though his supporters have made a video defending his involvement.
Agencies contributed to this report