There is singing, dancing, honking and cheering in the streets of Harare, as Zimbabwe celebrates the end of president Robert Mugabe's 37-year rule.

"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," said Mr Mugabe in a letter read out in Parliament. He made no mention of who would be taking over the presidency.

Thousands of people flocked to the streets holding framed photographs of army chief Constantino Chiwenga and former vice-president Emmerson Mnangagwa, whose sacking this month prompted the military takeover that forced Mugabe out.

Inside the building where parliament sat, a man dressed in a white shirt removed a portrait of Mugabe, while another man replaced the image with one of Mnangagwa.

Outside, in another symbolic scene, a man held up a smiling new-born wearing white, prompting joyous cheering from the crowds.

"I am so happy that Mugabe is gone, 37 years under dictatorship is not a joke. I am hoping for a new Zimbabwe ruled by the people," Tinashe Chakanetsa, 18, told AFP.

It was the end to a momentous week that saw the military take control, and the people of Zimbabwe protesting for an end to Mr Mugabe's reign.

British Prime Minister Theresa May said the resignation gave Zimbabwe "an opportunity to forge a new path free of the oppression that characterised his rule".

She said the Zimbabwean people have shown they want "free and fair elections and the opportunity to rebuild the country's economy under a legitimate government".

Mnangagwa expected to be Zimbabwe's next president

The ZANU-PF party legal secretary Patrick Chinamasa said Mnangagwa will be sworn in as president in the next 48-hours.

It was his dismissal that triggered the eventual decline of Mugabe. Mnangagwa formerly served as Mugabe's right-hand man.

"I think we're going to see Emmerson Mnangagwa sworn in very quickly" said Derek Matyszak, an analyst at the Pretoria-based Institute for Security Studies.

The United States embassy in Harare described it as an historic moment for Zimbabwe.

Many Zimbabweans have only known life under Mugabe, whose presidency has been characterised by violent suppression, economic collapse and international isolation.