Mohamed Morsi, a bespectacled and portly Muslim Brotherhood foot-soldier elevated from obscurity to become Egypt’s first freely elected civilian president, has died. He was 67.

He collapsed and died while attending a court hearing, Egyptian state media reported.

Egypt’s public prosecutor said there was no evidence of marks or injuries to his body but investigators would conduct a full autopsy and examine courthouse video for evidence. Amnesty International urged a transparent probe into the circumstances of Morsi’s death, while other rights advocates seized on it as proof authorities were denying him proper medical care.

A former opposition lawmaker, Morsi was elected to the country’s top office in June 2012, less than 18 months after joining a jail break amid the chaos of a mass uprising that swept away the three-decade rule of Hosni Mubarak.

While he sought to project himself as the “voice for all Egyptians,” that aspiration was divorced from the reality of his Islamist credentials. He spent much of his year-long presidency unable to emerge from the shadow of top Brotherhood officials, who were viewed as the nation’s real power brokers.

His fall was as crushing as his rise to power was stratospheric. Ousted by his army chief -- the future President Abdel-Fattah El-Sisi -- Morsi languished in prison after being convicted for conspiring with foreign militants in the prison breakout as well as passing state secrets to Qatar. The Brotherhood, a near-century-old movement that seeks to build societies centered on Islamic law, faced a sweeping crackdown in the wake of Morsi’s removal, with security forces killing hundreds of its supporters and imprisoning thousands.

“There’s no way to divorce Morsi’s fate from that of the Brotherhood,” said Hani Sabra, founder of the Alef Advisory consultancy in New York. “They were one and the same. He went the way of the Brotherhood.”

Morsi’s journey to the presidency was a stark contrast to his humble start. Born on Aug. 8, 1951, in Sharqiya province, his father was a farmer and his mother a housewife. He moved to Cairo in the late 1960s to study engineering at Cairo University. After completing his military service, Morsi returned to the university, earning a master’s degree and subsequently a doctorate from the University of Southern California.

An uninspiring orator, he thanked drivers of the three-wheeled tuk-tuks during his first televised speech. Later, listing his accomplishments, he cited reducing mango prices as one main gain of his first 100 days.

His rule became synonymous with a dangerous polarization as violent protests pit his backers against secularists and youth activists who played a key role in the 2011 Arab Spring revolt. Despite his claims of pursuing democracy, Morsi issued a constitutional decree in November 2012 that effectively granted him absolute power and the ability to direct the judiciary.

That move, which he later rescinded, put him on a collision course with Egypt’s judicial establishment in a battle that ultimately saw the Islamist-dominated parliament disbanded by court order. Critics maintain that the Brotherhood, subsequently outlawed as a terrorist organization, was looking to monopolize power at the expense of reviving the economy as growth plunged to its lowest level in almost two decades.

His list of failures extended into attempts to restore what the Brotherhood maintained was the erosion of Egypt’s position as a regional superpower under Mubarak. He opened a rapport with Shiite Muslim Iran, drawing condemnation from Egypt’s Sunni Muslim establishment, and built strong ties with Qatar, ultimately being charged with passing state secrets to the Gulf emirate.

Domestically, Morsi was seen by many as ill-suited to correct decades of corruption under Mubarak, when an autocratic establishment relied on the might of security forces to keep it in power.

Power outages were rife and a gasoline shortage emerged almost overnight, further stoking public rage that would reach a peak a year after his election.

In the final days of his presidency, Morsi, in a throwback to his predecessor, attempted to appease a roar of protest -- tossing out platitudes to masses willing to accept nothing short of his ouster.

“Polarization has reached a state of emergency that endangers our nascent democratic experience and threatens chaos,” he said in a June 2013 speech. “I took power at a difficult time -- at times I was right, at times I was wrong.” He said the opposition was “aligning itself with enemies of the revolution.”

Foreign leaders who’d had ties to Morsi and his Islamist movement were quick to express their shock at his death.

Turkish President Recep Tayyip Erdogan, a fierce critic of Morsi’s overthrow, described him on Twitter as a “martyr.” Meanwhile, Rashid Ghannouchi, head of the Brotherhood-aligned Ennahda party in Tunisia, said the group hoped his passing would lead to the release of political prisoners and an open dialogue between parties.

Morsi’s health had reportedly deteriorated in prison, where he faced conditions harsher than those of his predecessor, Mubarak, who spent much of his incarceration in a military hospital.

While the Brotherhood has been driven underground by a crackdown that later expanded to include activists and other critics, analysts say his death could again ignite tensions.

Morsi is survived by his wife and five children.