Cairo: Egypt's first freely elected president Mohamed Morsi, who was toppled in a coup on Wednesday, is a veteran Islamist who is no stranger to underground politics having broken out of jail just 30 months ago.
As the army rounded up hundreds of his comrades from the Muslim Brotherhood, Morsi's own whereabouts remained unclear.
But he seemed destined to return to the largely clandestine existence in and out of jail that he led through three decades of ousted president Hosni Mubarak's authoritarian rule when the movement was outlawed, if tolerated within certain bounds.
During Morsi's first entry onto the national political stage in 2000 when he was elected to parliament, Morsi was forced to stand as an independent because of the Mubarak-era ban on the Brotherhood.
During his 12-month tenure of Egypt's highest office, there were no such constraints on his politics, and it was his alleged partisanship towards the Brotherhood that was ultimately to prove his undoing.
Millions took to the streets on Sunday in response to a grassroots campaign accusing him of breaking his promise to be a "president for all Egyptians" and of failing the ideals of the 2011 revolution.
Morsi remained defiant to the end, insisting on the legitimacy of his election in June last year when he defeated several of the main opposition leaders. But he had to do so through pre-recorded messages posted on the Internet or aired by independent television channels.
It was a far cry from the rapturous reception he was given by adoring crowds in Cairo's Tahrir Square less than 13 months ago, when he was feted as a revolutionary champion.
Then his informal style and colloquial speech earned plaudits from a public estranged by the stiff, pharaonesque aloofness of Mubarak-era officials.
But when he took to the microphone late on Tuesday for his final address to the nation as head of state, his rambling unscripted delivery appeared unpresidential and the tens of thousands of protesters camped out on the streets united in disavowing him as their leader.
Morsi was not the Brotherhood's first choice as candidate for the presidency -- that decision went to the more charismatic Khairat El-Shater. But Shater was barred from standing because of a past prison sentence.
Morsi, now 61, had been the spokesman of the Brotherhood from 2010, which gave him public recognition.
He was arrested on January 28, 2011, the day after the Brotherhood threw its weight behind the protests against Mubarak.
It was not his first spell behind bars. He had already served seven months in 2006 for taking part in a demonstration in support of reformist judges.
He was among dozens of Islamist prisoners sprung from jails around the country during the collapse of public order that accompanied the revolution.
His failure to address the resulting insecurity and its devastating impact on the economy and Egypt's once lucrative tourism industry was a major factor in his plummeting esteem as president.
Scores died in persistent political violence, many more in criminal activity, dashing the hopes of the Arab Spring for a better, more prosperous Egypt.
During Morsi's presidency a number of recordings emerged of remarks he had made during his period underground that his critics judged as anti-Semitic.
But during his presidency he made good on his election promise to leave Egypt's 1979 peace treaty with Israel untouched despite his gut sympathy with the Islamist Hamas rulers of Gaza.
He also kept up Cairo's longstanding defence ties with Washington which earn it $1.3 billion (1 billion euros) a year in US military aid, assistance called into doubt by President Barack Obama after Wednesday's coup.
Morsi received a PhD from the University of Southern California, where he was also an assistant professor in 1982.
He had graduated with an engineering degree from Cairo University in 1975.
Morsi is married, with five children and three grandchildren.