This is amid mass demonstrations against an attempt to extend his 27-year rule in the West African country.
Compaore, who seized power in a 1987 coup, had attempted to defy popular pressure for him to step down after a day of violent protests on Thursday in which demonstrators stormed parliament and state television.
(READ MORE: Burkina protestors burn parliament, ransack State TV)
However, with hundreds of thousands of protesters packing the streets of the capital Ouagadougou for a second day on Friday and no sign of international support for him staying on, Compaore announced his resignation.
“I declare a vacancy of power with a view to allowing a transition that should end with free and transparent elections in a maximum period of 90 days,” Compaore said in a written statement read on local radio and television.
A heavily armed convoy believed to be carrying Compaore was seen travelling on Friday towards the southern town of Po, near the border with Ghana, two diplomatic sources and local media said.
Crowds danced and cheered in Ougadougou’s dusty streets, blowing on whistles after Compaore’s statement was broadcast. The mood cooled, however, as it became plain that military chief General Honore Traore had taken over the reins of power.
Under Burkina Faso’s constitution, when the president resigns the head of the National Assembly should take office, but parliament had already been dissolved by the Traore on Thursday under short-lived martial law.
“Considering the urgency of saving the nation, I have decided that I will assume from this day the responsibility of the head of state,” Traore told a news conference.
“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.”
There was no immediate reaction from opposition leaders to Traore’s announcement.
Many protesters said they wanted a transition led by retired General Kouame Lougue, a popular former defence minister who was accused of trying to topple Compaore in 2004.
Long a bastion of stability in the turbulent Sahel region, Burkina Faso’s crisis is being closely watched by military allies France and the United States, and by governments in the region where several long-standing rulers are approaching the end of their mandates amid rumbling of popular discontent.
“This is a sub-Saharan Spring and it must continue against all the presidents who are trying to hang on to power in Africa,” said law student Lucien Trinnou, referring to the Arab Spring that toppled several long-term leaders.
(READ MORE: Burkina president rejects opposition calls to step down after violence)
French President, Francois Hollande, who had discretely sought ways to usher Compaore into an international role when his term was due to have ended next year, welcomed the former president’s resignation in a statement and called for quick elections to be held.
Burkina Faso is one of the world’s poorest nations but has positioned itself as a mediator in regional crises. It is also a key ally in Western operations against al Qaeda-linked groups in West Africa and one of the last African states to retain diplomatic relations with Taiwan.
Regional West African bloc ECOWAS said on Thursday it would not accept any party seizing power through non-constitutional means in an apparent suggestion of diplomatic pressure to leave Compaore in place.
A delegation from the African Union, the United Nations and ECOWAS was due in Burkina Faso on Friday to hold talks with all parties.