After 27 years in power, Burkina Faso President Blaise Compaore stepped down in the wake of violent anti-government demonstrations demanding his ouster.

Army General Honore Traore, the West African nation’s joint chief of staff assumed power Friday, state radio announced.

Opposition protesters had gathered in the country’s capital Friday morning, a day after their violent demonstrations pushed the country's longtime president to agree to relinquish power next year. Protesters stormed the parliament Thursday to prevent lawmakers from voting to allow Compaore to seek another term in office. They sacked and burned the parliament, attacked Cabinet ministers' houses and looted around the country.

For months, an opposition coalition had been urging Compaore not to seek re-election for what would have been his fifth term in power. But Compaore and his ruling party looked set to push a bill through parliament Thursday that would have allowed him to run again.

In response to the chaos Thursday, a brief period of martial law was imposed during which the military announced the dissolution of parliament and promised an interim government that would include all parties.

Compaore later said he would lead that transitional government until elections next year and then relinquish power but that proved not enough for the opposition.

A crowd of demonstrators in the capital burst into cheers Friday when they heard the announcement of Compaore's resignation.

"I declare that I'm leaving power in order to have a free and transparent election in 90 days," said Compaore in a statement read out on television and radio stations. "For my part, I think I have fulfilled my duty."

Compaore, 63, said he decided to leave power "in light of the severely deteriorated sociopolitical situation and the threat of division in our national army and out of a desire to preserve the peace."

With the parliament and the government dissolved a day earlier, the military, which has had a visible role in this crisis, stepped into the vacuum.

The eruption of violence and images of cars on fire and plumes of black smoke in the capital of Ouagadougou Thursday alarmed many in the international community. The United States welcomed Compaore's announcement that there would be a democratic transition.

The U.N. special representative for West Africa is expected to arrive in the country Friday.

Compaore first came to power following an October 1987 coup against then-President Thomas Sankara, Compaore's longtime friend and political ally who was killed in the power grab. For many, his legacy begins and ends with the death of Sankara, a well-regarded statesman whose death was widely viewed as a setback for the entire continent.

After he took power in his own coup, Compaore developed a reputation as a meddler and a supporter of regional conflicts. He kept a tight leash on any opposition, never grooming a viable political heir as he fought off threats to his power.

He openly supported Charles Taylor, the Liberian warlord turned president, though he denied active involvement in the Liberian conflict. Compaore also was accused of supporting rebel groups in Ivory Coast and Angola.

But more recently, he had refashioned himself as an elder statesman who brokered electoral disputes and hostage releases throughout West Africa.

Compaore was headed south to the city of Po, near the border with Ghana, a French diplomatic official said on condition of anonymity, citing the sensitivity of the situation. He is still in Burkina Faso, and it was not clear if he was trying to cross, the official said. He had not asked the French, who were once the country's colonial rulers, for any help.

The Associated Press contributed to this report.