THE head of Burkina Faso's armed forces has seized power after President Blaise Compaore resigned amid mass demonstrations against an attempt to extend his 27-year rule in the West African country.

Mr 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.

However, with hundreds of ­thousands of protesters packing the streets of the capital Ouagadougou for a second day yesterday and no sign of international support for him staying on, Mr 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," Mr Compaore said in a written statement read on radio and television.

A heavily armed convoy believed to be carrying Mr Compaore was later seen travelling towards the southern town of Po, near the border with Ghana.

Crowds danced and cheered in Ougadougou's streets after Mr Compaore's statement was broadcast. The mood cooled, however, as it became clear 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 General Traore on Thursday under short-lived martial law.

He said: "Considering the urgency of saving the nation, I have decided I will assume from this day the responsibility of the head of state.

"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."

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 Mr Compaore in 2004.

For months, an opposition coalition had been urging Mr Compaore not to seek re-election next year,

Long a bastion of stability in the turbulent Sahel region, Burkina Faso is being closely watched by military allies France and the US and by other governments in the region, where several long-standing rulers are approaching the end of their mandates amid rumbling of popular discontent.

French President Francois Hollande, who had discretely sought ways to usher Mr Compaore into an international role when his term was due to have ended next year, welcomed the former president's resignation 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 Mr Compaore in place.

A delegation from the African Union, the UN and Ecowas is due in Burkina Faso this weekend to hold talks with all parties.