Correspondents say the city hall and ruling party headquarters are also in flames.
A huge crowd is surging towards the presidential palace and the main airport has been shut.
MPs have suspended a vote on changing the constitution to allow Mr Compaore to stand for re-election next year.
Five people have been killed in the protests, among the most serious against Mr Compaore’s rule, reports BBC Afrique’s Yacouba Ouedraogo from the capital.
The military fired live bullets as protesters stormed parliament, our correspondent says.
Journalists are now gathered outside the defence ministry awaiting a statement from the military, he says.
Witnesses say dozens of soldiers have joined the protests, including a former defence minister, Gen Kouame Lougue.
The main opposition leader, Zephirin Diabre, has called on the military to side with “the people” and has demanded the resignation of the president.
Thousands of protesters have gathered in Ouagadougou
Mr Compaore’s whereabouts are unknown, but he has appealed for calm via Twitter.
He first took power in a coup in 1987, and has won four disputed elections since then.
At the scene: Joost Laane, speaking to BBC Focus on Africa
I am in an area where many MPs live and I have seen two of their homes set ablaze and smoke coming out of another two or three homes. Hotel Azalai, one of the main hotels in the city, is also on fire.
Two helicopters flew over my house – the president’s and a normal helicopter. I cannot confirm whether the president was in one of them.
No-one knows what is going to happen next. It is chaotic and tense. We hear sporadic gunfire.
There is no TV anymore. So we are depending on internet access and phone calls. The 3G network and the texting system are blocked.
The opposition has called for a campaign of civil disobedience to demand that he steps down in elections next year.
“October 30 is Burkina Faso’s black spring, like the Arab Spring,” opposition activist Emile Pargui Pare told AFP news agency.