TEHRAN - Born into a religious family in the Shiite Muslim holy city of Mashhad on August 23, 1960, Ebrahim Raisi wears the black turban of a "seyed" whose genealogy is said to lead back to Prophet Mohammed.
In public, he has an austere charisma, and is surrounded by an entourage with ties to the Islamic regime's most hardline elements.
He has focused his campaign on the poor, brandishing his credentials as the head of the Imam Reza shrine in Mashhad, which is also a powerful and hugely wealthy charitable foundation.
"I represent the workers, the farmers, the impoverished women," he says, vowing to triple cash handouts.
It is a message that has fallen on fertile ground at a time when unemployment is at least 12.5 percent and almost everyone is feeling the stagnation of the economy.
He does not oppose the deal signed with world powers in 2015, which lifted sanctions in exchange for curbs to Iran's nuclear programme.
But he says the current government's negotiating efforts were "weak" and called for a much tougher line "in the face of the enemy".
There is little chance Raisi will ease social restrictions or release opposition leaders held under house arrest since the 2009 protest movement, known to conservatives as "the sedition".
"Those who sympathise with the heads of sedition must know that the great nation of Iran will never forgive this great injustice," he said in 2014.
- A revolutionary life -
Raisi is entrenched in the conservative establishment, having served as attorney general, supervisor of state broadcaster IRIB and prosecutor in the Special Court for Clerics.
His father-in-law leads Friday prayers in Mashhad and both have seats on the Assembly of Experts that will choose the next supreme leader -- a position for which Raisi himself is often rumoured to be in the running.
Raisi's father died when he was five, and he entered the seminary at an early age, excelling in his studies and moving to the seat of clerical learning in Qom in 1975.
After the 1979 revolution, he was selected for special training by the clerical establishment and studied under Ali Khamenei, who would later become supreme leader.
In 1985, in the midst of the Iran-Iraq war, he became deputy prosecutor at the Revolutionary Court of Tehran that would oversee the execution of thousands of political prisoners.
After serving in a series of increasingly powerful judicial posts, Raisi was appointed by Khamenei in March 2016 to head the Imam Reza shrine.
Known as Astan Qods Razavi, it runs Iran's holiest shrine as well as a huge business conglomerate with interests in everything from IT and banking to construction and agriculture.