Gen Traore announced that a "transitional body [would] be put in place in consultation with all parties".
"A return to the constitutional order is expected in no more than 12 months," he said.
Earlier, President Compaore issued a statement, declaring the emergency and saying that the head of the armed forces was in charge of implementing the decision.
The protests in the capital - the most serious yet against Mr Compaore's rule - forced MPs to abandon a vote aimed at allowing the president to seek re-election in 2015.
The military fired live bullets to try to disperse protesters who had occupied parliament, our correspondent says.
Protesters also surged towards the presidential palace, and a government helicopter flying overhead fired tear gas at them, Reuters news agency reported.
Witnesses say dozens of soldiers joined the protest in Ouagadougou's main square, including a former defence minister, Gen Kouame Lougue.
Protesters demanded his installation as president, our reporter says.