Embattled Zimbabwe dictator Robert Mugabe resigned Tuesday, marking an extraordinary end to a brutal reign of nearly four decades, officials said.

The 93-year-old African dictator — at first defiantly refusing to step aside after a military takeover last week — finally bowed to mounting pressure and said he would leave office “with immediate effect” in a letter sent to his country’s ruing body, the Associated Press reported.

“I Robert Gabriel Mugabe in terms of secion 96 of the constitution of Zimbabwe hereby formally tender my resignation,” the letter said, according to the BBC.

His resignation came as the country’s parliament was meeting to impeach him, officials said.

Parliament members erupted in wild cheers at the news, while the streets outside soon filled with dancing, cheering residents.

Mugabe’s former vice president, Emmerson Mnangagwa, known as “The Crocodile,” will assume power in 48 hours, a ruling party official told AP.

Mugabe’s 37 years in power were infamous for their violence and economic turmoil.

But recently, his wife, Grace, 52, took center stage in terms of controversy, as fears mounted that she planned to take over the helm from her aged husband. She had been nicknamed “Gucci Grace” for her love of luxury items.

Mugabe did himself no favors by recently booting Mnangagwa, who had been expected to succeed him. This prompted the military takeover and ultimately, Mugabe’s downfall.

In a televised address over the weekend, Mugabe suggested he would fight to stay in office. He had been forced to seek exile in his home last week.