Born in 1960 in Mashhad, home to Iran's holiest Shia Muslim shrine, he followed in the footsteps of his father, a cleric, and started attended a seminary when he was 15.
He took part in protests against the Western-backed Shah, who was toppled in 1979, while a student and went on to become the deputy prosecutor in Tehran at just 25.
In the late 1980s, he sat on secret tribunals believed to have sentenced thousands of political prisoners to death in what humans rights group say constituted a crime against humanity.
Raisi succeeded Hassan Rouhani as president after a poll which saw many prominent moderate and reformist candidates barred and the majority of voters stay away.
He took power with Iran already facing multiple challenges but his time in office has been dominated by anti-government protests as well as the current war in Gaza.
With updates from BBC Persian and Chief International Correspondent Lyse Doucet