Robert Mugabe announced his resignation as President of Zimbabwe, as parliament began impeachment proceedings to strip him of power and open the way for prosecution.

His departure, after a stand-off lasting days following a military coup, brings an end to the reign of a man who was Africa’s longest-serving head of state, and one of the best known and controversial figures in international politics.

The announcement of the resignation came with the drama that has been one of the hallmarks of this extraordinary saga. The motion of impeachment was being debated by the National Assembly and the Senate, with speaker after speaker lining up to denounce the President, when the news came that he had gone.

There was a moment of silence when speaker Jacob Mudenda adjourned the debate and gave the reason why. Then there was pandemonium, with MPs and Senators clapping, shouting, cheering and hugging each other.

The noise inside the Harare International Conference Centre, where proceedings had been moved to accommodate the two houses of parliament, was soon matched and surpassed by roars from outside, followed by the noise of car horns and music.

There was relief among many in Zanu-PF that the matter was not to drag on longer than it already had. Critics say that skeletons from the party’s decades in power may have come tumbling out if the impeachment process had run its full, long course. Mr Mugabe would also have faced more humiliation.

Lovemore Matuke, the chief whip, said: “I am very happy that the President has chosen to go voluntarily. This would have ended in serious embarrassment.”

Former Vice President Emmerson Mnangagwa, who had been sacked recently by Mr Mugabe – at the instigation, it is claimed, of Grace Mugabe – will be appointed president in the next 48 hours, the ruling party announced.

Zanu-PF had removed Mr Mugabe as its leader, replacing him with Mr Mnangagwa, last week. According to the constitution, it should be the current Vice President Phelekezla Mphoko who takes over, but she is a supporter of Grace Mugabe and thus out of the running.

Mugabe's first public appearance since Zimbabwe military takeover Show all 9 1 /9 Mugabe's first public appearance since Zimbabwe military takeover Mugabe's first public appearance since Zimbabwe military takeover President Robert Mugabe, center, arrives to preside over a student graduation ceremony at Zimbabwe Open University AP Mugabe's first public appearance since Zimbabwe military takeover Zimbabwe's President Robert Mugabe arrives at student graduation ceremony AP Mugabe's first public appearance since Zimbabwe military takeover President Robert Mugabe prepares to speak at a student graduation Ap Mugabe's first public appearance since Zimbabwe military takeover Members of the Presidential Guard EPA Mugabe's first public appearance since Zimbabwe military takeover President Robert Mugabe arrives at his first public appearance at a graduation ceremony in Harare AP Mugabe's first public appearance since Zimbabwe military takeover President Robert Mugabe confers awards for the students with the leading theses AP Mugabe's first public appearance since Zimbabwe military takeover Robert Mugabe makes his first public appearance EPA Mugabe's first public appearance since Zimbabwe military takeover Soldiers stand guard as President Robert Mugabe attends a university graduation ceremony REUTERS Mugabe's first public appearance since Zimbabwe military takeover President Robert Mugabe AP

In his resignation letter, Mr Mugabe stated: “My decision to resign is voluntary on my part and arises from my concern for the welfare of the people of Zimbabwe and my desire for a smooth, non-violent transfer of power.”

But his fate and that of his wife, who is accused of abuse and corruption, and nicknamed “Gucci Grace” and “DisGrace” for her lavish spending as the country turned into an economic basket case, remains unclear.

The President is believed to have secured immunity from prosecution for himself and his family in negotiations with the military high command, in return for standing down.

But he used a speech on Sunday evening, in which he was due to announce his resignation, to insist that he would stay in power. Officials now say they do not know if the offer of immunity still stands.

The inglorious end to 93-year-old Mr Mugabe’s attempts to cling on to power came three-and-half hours after the initial impeachment proceedings had begun, in an atmosphere of excitement and tension in the packed and overflowing chamber of the parliament in Harare.

Just before the proceedings got under way, a man in the public gallery shouted: “Don’t let us down!” Outside, protesters denounced the President and demanded that he go immediately: posters with faces of Mr Mugabe and his wife Grace were laid on the road to be walked and driven over.

The crowd outside could be heard as the speaker reminded the MPs that what they were about to undertake was “unprecedented and historic” in the nation since independence. As the parliamentarians moved to the larger Conference Centre, there were further reminders from those gathered outside that it was their duty to protect the country from Mr Mugabe who, there were rising fears, may be trying to organise a counter-coup.

But any last attempts to arrive at a settlement which may have allowed Mr Mugabe a bit more time had failed. The military, who had carried out a coup last week, announced on Monday evening that talks would be held between Mr Mugabe and Mr Mnangagwa when the latter returned from exile in South Africa.

For his part, the former Vice President on Tuesday accused Mr Mugabe of being behind a plot to murder him, and said he would only return when it was safe to do so. The fate of the President, he implied, was already sealed, and he had a warning for anyone who would take Mr Mugabe’s place

“I am aware that parliament intends to impeach the President,” he said. “Parliament is the ultimate expression of the will of the people outside an election, and in my view it is expressing national sentiment by implementing that impeachment. Never should the nation be held at ransom by one person ever again, whose desire is to die in office at whatever cost to the nation.”

Mr Mugabe’s departure was greeted with satisfaction by much of the international community. The US embassy in Harare said it was a “historic moment” and congratulated Zimbabweans who “raised their voices and stated peacefully and clearly that the time for change was overdue”.

In London, Theresa May said the resignation “provides Zimbabwe with an opportunity to forge a new path free of the oppression that characterised his rule”. Britain, “as Zimbabwe’s oldest friend”, will do all it can to support free and fair elections and the rebuilding of the Zimbabwean economy, she added.

South Africa’s main opposition party, the Democratic Alliance, welcomed the move, saying Mr Mugabe had turned from “liberator to dictator”.

But Jacob Zuma’s government, along with a number of other ones in the African Union and South African Development Community (SADC), haS spoken out against the removal of the President by a military takeover. Mr Zuma, and the Angolan President Joao Lourenco, had been due to fly to Zimbabwe on Wednesday to mediate between Mr Mugabe and the military.

There have also been questions in Zimbabwe about whether Mr Mnangagwa, nicknamed “the Crocodile”, was the right person to lead Zimbabwe to a future of reform and out of the grip of corruption.

The 75-year-old former intelligence chief was very much part of the Zanu-PF old guard, and had been associated with allegations of graft and vote rigging in the past. He was reportedly targeted by US sanctions in the early 2000s for undermining democratic development in his country.

Samuel Demba, a 23-year-old student who had rushed from university to the city centre on hearing about the resignation, was concerned that “the old ways may continue”.

“We have had 40 years of Mugabe before we managed to get rid of him. Do we really want someone who had been with him all that time to be President?” he asked.

At this point two friends, who had come running, draped a Zimbabwean flag around his head. “The time to worry about all that will come later, Sammy,” said Amanda Katsande. “We need to enjoy ourselves tonight. This will be a time everyone will remember. Zimbabwe does not make news for that many good things. But what happened today is really good; we have shown we can bring change to our country.”

There was also debate, amid the celebrations, about whether Mr Mugabe and his cohort should be tried.

“Yes, absolutely, that should happen” was the view of Matthew Basopo. “Mugabe helped Grace to steal from Zimbabwe, there were others who then benefited from her crimes.