Mr Compaore had earlier said he would step down after a 12-month transitional government had ended.
However, the opposition continued to demand that he resign, angry at his attempts to amend the constitution and extend his 27-year rule.
On Thursday, protesters set fire to parliament and government buildings.
There were cheers when the army spokesman told the crowd gathered in front of army headquarters on Friday that Mr Compaore had left office, Agence France-Presse reported.
Reuters news agency reported that an army colonel had also announced the resignation on television.
Mr Compaore earlier said he had agreed not to seek another term, but that he would remain in power until a transitional government had completed its work in 2015.
However, the opposition rejected his statement. Its leader, Zephirin Diabre, urged protesters to occupy public spaces.
Courtesy of www.bbc.com