The outgoing president was still in Burkina Faso on Friday afternoon, and it was not clear if he was trying to cross the border, the official said. He had not asked the French, who were once the country's colonial rulers, for any help.
For months, an opposition coalition had been urging Compaore not to seek re-election. But Compaore and his ruling party appeared ready on Thursday to push through a bill that would have allowed him to run again.
Determined to block the vote, protesters stormed the building, setting part of it on fire. At least three people were killed in the protests, according to Amnesty International, and dozens of demonstrators were shot.
Images of flames enveloping the legislature, cars burning in the streets and protesters massing in the capital raised the specter of a long standoff. But events moved swiftly, with the government suspending the vote and the military announcing that the legislature had been dissolved and an interim government would be formed.
After that, Compaore said he would lead until the new elections.
Protesters rejected that plan and gathered again Friday, demanding that Compaore step down immediately.
It was a sharp about-face for a ruler who had survived other attempts to overthrow his regime.
Compaore first came to power following the 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.
Compaore has reinvented himself many times over the years. As a young man, he was in the military. He became justice minister when troops marched on Ouagadougou, the capital, in 1983 and installed Sankara as president. After he took power in his own coup, he developed a reputation as a meddler and a supporter of regional conflicts.
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.
More recently, he has refashioned himself as an elder statesman who brokered electoral disputes and hostage releases throughout West Africa.
Domestically, he kept a tight leash on any opposition, never groomed a viable political heir and fought off threats to his power.
In 2011, waves of protests washed over Burkina Faso, challenging Compaore's rule, and mutinous soldiers occupied the palace at one point, forcing the president to flee.
But what would have spelled the end for many presidents was a temporary problem for Compaore. He maneuvered to stay in power by removing his security chiefs and appointing himself defense minister before returning to Ouagadougou.