Burkina Faso’s President Blaise Compaore has announced his resignation, following violent protests at his attempt to extend his 27-year rule.
Mr Compaore issued a statement saying the presidency was now vacant and urging elections within 90 days.
Military chief Gen Honore Traore said he had taken over as head of state “in line with constitutional measures”.
Crowds danced and cheered in the capital, Ouagadougou, after Mr Compaore’s resignation was broadcast.
On Thursday, protesters angry at his attempt to amend the constitution had set fire to parliament and government buildings.
There was a euphoric atmosphere in the Place de la Nation as the thousands of protesters heard that Blaise Compaore was no longer their president.
The demonstrators sang the national anthem. But the crowds have no intention of going home, as they are unhappy that Gen Honore Traore has been appointed as transitional head.
He is seen as too close to the ousted president – he was Blaise Compaore’s aide de camp – and for these demonstrators that is not enough of a rupture with the past. They have been chanting “Lougue, Lougue, Lougue” – the name of retired Gen Kouame Lougue, a former defence minister who fell out with Mr Compaore in 2003.
“This is not a coup – this is a popular uprising,” one man in the crowd said. “We rose up, we fought and we won, and now we are saying we want this man to lead. We don’t want Honore, we want Kouame Lougue.”
Mr Compaore had earlier vowed to remain in power until a transitional government completed its work in 2015, although he had agreed not to seek another term.
However, the opposition continued to demand that he resign – a key leader, Zephirin Diabre, urged protesters to occupy public spaces.
After the resignation, Mr Diabre told the BBC’s Focus on Africa radio programme: “We are all relieved by what is happening – and this is our demand for so long so we are very happy – and we need to work on the transition to take care of our country.”
Mr Compaore’s statement, read on television, said: “In order to preserve the democratic gains, as well as social peace, I declare a power vacuum to allow the establishment of a transition leading to free and fair elections within a maximum of 90 days.”
He added: “For my part, I think I have fulfilled my duty.”
His whereabouts now remain unclear.
However, Reuters news agency reported that a heavily armed convoy believed to be carrying Mr Compaore was travelling towards the southern town of Po.
One protester, Sam, told the BBC: “Blaise Compaore has gone away, he’s running away and we are happy. The words are not coming so easy because I’m very happy, my children are going to know another president.”
France welcomed the resignation, saying it “allows a solution to be found to the crisis”.
In a statement, Gen Traore said: “In line with constitutional measures, and given the power vacuum… I will assume as of today my responsibilities as head of state.”
He added: “I undertake a solemn engagement to proceed without delay with consultations with all parties in the country so as to start the process of returning to the constitutional order as soon as possible.”
An army spokesman, Lt Col Isaac Zida, later told reporters the constitution had been suspended, but it was unclear whether he was speaking on behalf of Gen Traore.