After reports of heavy gunfire near the presidential palace early on Saturday, Lieutenant Colonel Issaac Zida, the operational commander of the elite presidential guard, announced on radio that he was taking power.
"I assume from today the responsibilities of head of this transition and head of state," Zida said, dressed in military fatigues, in the studio of BF1 television.
Read More First Ebola Vaccine Trial Starts in Africa
"I salute the memory of the martyrs of this uprising and bow to the sacrifices made by our people."
The unfolding crisis was being closely watched by the United States and former colonial power France, which were close military allies of Compaore.
Under his rule, Burkina Faso became a key ally in Western operations against al Qaeda-linked groups in West Africa.
The events will also be carefully followed by other governments in West and Central Africa, where long-serving leaders are reaching the end of their constitutional terms in several countries, including Benin, Congo Republic and Democratic Republic of Congo.
Zida said the army had stepped in to avoid anarchy and ensure a swift democratic transition. He said a roadmap to elections would be drafted by a body drawn from different elements of society, including political parties and civil society.
Read More Silicon Savannah: Is Africa tipped for a tech take-off?
He appealed to the African Union and West African regional bloc ECOWAS to show its support for the transition.
"This is not a coup d'etat but a popular uprising," he told Reuters after making the statement. "The people have hopes and expectations, and we believe we have understood them."
Borders, Airport Closed
It was the seventh time that a military officer had taken over as head of state since the country declared independence from France in 1960, when it was known as Upper Volta.