Burkina Faso President Blaise Compaore announced he is resigning on Friday amid a nation-wide call for an end to his 27-year rule.

"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," Compaore said in a televised statement issued Friday, the BBC reported.   

"For my part, I think I have fulfilled my duty," the president said.

Compaore's resignation comes just hours after he said he would not leave office, despite an outbreak in mass protests and calls from the opposition for his immediate resignation.

As Compaore announced he was leaving, Military chief General Honore Traore said he will take over as head of state.

"In line with constitutional measures, and given the power vacuum...I will assume as of today my responsibilities as head of state," Traore said according to the BBC.

The general's ascension to power also comes hours after he announced parliament has been dissolved and a transitional government would take effect - which Compaore said he would lead until November 2015.  

At the heart of the conflict is Compaore's now abandoned plan to amend the constitution to get rid of limits placed on presidential terms, allowing him to run in the 2015 elections. The current constitution only allows presidents to serve two terms of five years each.

Protests erupted Thursday in the capital Ouagadougou, with locals setting fire to parliament and the homes of politicians, the BBC reported. Opposition leader Zephirin Diabre also called for the president's resignation, urging the public to occupy public areas to increase the pressure.

Compaore is a former soldier who first came to power in 1987 after then President Thomas Sankara was killed by a group of soldiers, the BBC reported. He would have been seeking a fifth term in office had he been allowed to run in 2015. 

Read the earlier story about the Thursday protests here.