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”.
On Thursday, protesters angry at Mr Compaore’s attempt to amend the constitution set fire to parliament.
Burkina Faso’s immediate former President Blaise Compaore
Following the protests, Mr Compaore said he had agreed not to seek another term, but that he would remain in power until a transitional government had completed its work in 2015.
However, the opposition continued to demand that he resign. Its leader, Zephirin Diabre, urged protesters to occupy public spaces.
Burkina Faso citizens took to the streets to celebrate.
There were cheers when an army spokesman told the crowd gathered in front of army headquarters on Friday that Mr Compaore had left office, AFP news agency reports.
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.
France welcomed the resignation, saying it “allows a solution to be found to the crisis”.
Gen Traore has now said he has taken over.
In a statement, he 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.”
Late on Thursday, he had announced the creation of the transitional government, declared the dissolution of parliament and imposed a night curfew.