Robert Mugabe, who ruled Zimbabwe for 37 years and plunged the southern African nation into political and economic chaos as he violently clung to power, has died. He was 95.

“It’s with the utmost sadness that I announce the passing” of Mugabe, Zimbabwean President Emmerson Mnangagwa said Friday on Twitter. Mugabe died in Singapore, where he was hospitalized in April for an undisclosed ailment.

The one-time schoolteacher was a leading political driver of the 1970s independence war that ended white-minority rule. But he became an international outcast as he faced accusations of rigging elections, suppressing dissent and triggering an economic collapse by condoning the seizure of white-owned farmland. He finally resigned in November 2017, after the military seized control of the country and his own party threatened to impeach him.

“He was a hero who turned into a villain,” said Charles Rukuni, a political analyst and publisher of the Insider newsletter, who’s based in Harare, the capital. “He ushered in independence and brought a lot of hope but destroyed everything he built.”

The son of a carpenter and a catechism teacher, Mugabe was born on Feb. 21, 1924, in Zvimba, a poor farming area west of Harare, then known as Salisbury, and trained as a primary-school teacher.

He was introduced to politics while studying at South Africa’s Fort Hare University, and became a founding member of the Zimbabwe African National Union party in 1963. He was jailed the same year for calling for the violent overthrow of Ian Smith’s white-minority government.

During his 11-year incarceration, Mugabe obtained degrees in economics, education and law. A year after his release, he fled to Mozambique where he later became a leader of the then-exiled Zanu, which controlled the biggest of two guerrilla armies fighting for the liberation of Rhodesia, as the country was known at the time.

A U.K.-brokered peace deal that ended the war brought Mugabe to power as the elected prime minister in 1980. He won global acclaim as he preached reconciliation, slashed the country’s infant mortality rate and expanded education. Rich in gold, platinum and fertile land, the young nation was touted by many as Africa’s brightest hope.

The honeymoon didn’t last long. In 1982, Mugabe accused his coalition partner, Joshua Nkomo, of plotting to overthrow him and began a military crackdown in his rival’s western Matabeleland stronghold that Genocidewatch.org estimates claimed about 20,000 lives.

Support for Mugabe ebbed as the economy floundered, and he encountered serious political opposition after labor unions and civil-rights groups banded together in 1999 to form a new opposition party — the Movement for Democratic Change, or MDC. The following year Mugabe lost a constitutional referendum that would have permitted his administration to seize land without compensation.

Mugabe ignored the outcome of the plebiscite and allowed government-backed militants to take over about 4,000 mostly white-owned commercial farms. Exports of tobacco, one of the mainstays of the economy, collapsed, and food shortages became rife in a country that had once been southern Africa’s second-biggest corn exporter. In 2005, Mugabe authorized a slum-clearance program that left at least 750,000 people homeless, according to the Zimbabwe Human Rights NGO Forum.

After the land-seizure program and other policy missteps depleted the state’s coffers, the central bank began printing money to enable the government to pay its workers, resulting in hyperinflation and shortages of everything from gasoline to medicines.

The crisis eased in 2009 when Zimbabwe scrapped its own currency and adopted mainly the U.S. dollar as legal tender — which it used until a local quasi-currency was introduced this year. The economy never fully recovered and is now in the doldrums.

More then 90% of the workforce isn’t formally employed, public infrastructure is crumbling, and there are shortages of cash and electricity. The government has responded to a resurgence in inflation by halting the publication of the data for six months.

While Mugabe was the clear winner of the first four post-independence elections, his victory in a violence-marred 2008 vote was disputed and his party lost control of parliament. Mugabe refused to step down and international mediators coaxed him into a power-sharing deal with the MDC. That lasted until 2013 when Mugabe reclaimed outright control in an election the opposition said was neither free nor fair.

Mugabe’s ouster was the culmination of a long-running battle for control of the ruling party between a military-aligned faction that coalesced around one-time spy chief Emmerson Mnangagwa and another known as the Generation-40, which wanted the president’s wife, Grace Mugabe, to succeed him.

When Mugabe fired Mnangagwa as his vice president, the military turned on him, and Mnangagwa returned from a brief exile and took over the presidency.

“We have lost a man that we, Zimbabweans, should recognize for the unparalleled role he played in the decolonization and liberation of the country,” MDC leader and former Finance Minister Tendai Biti said by phone. “We mourn a giant. We also acknowledge the omissions that were committed, for instance the economic destruction of our country and the physical abuse.”

Mugabe and his wife Grace had three children.