In the confusion, a group of 20 lawmakers and government officials took refuge at the Mexican ambassador's residence, and Mexico announced it was offering asylum to Morales as well.
"It hurts me to leave the country, for political reasons, but I will always be concerned".
Mexico's Foreign Secretary Marcelo Ebrard granted Morales' asylum request at a press conference on November 11.
The left-wing leader said he and the Bolivian government were "very grateful" to Mexican President Andres Manuel Lopez Obrador, whom he credited with saving his life.
After it was published, Bolivia's army chief, Gen. Williams Kaliman, also publicly called for Morales to leave his post.
Cuba "expresses solidarity with its brother president Evo Morales", Foreign Minister Bruno Rodriguez said in a tweet, describing Morales as "a protagonist and a symbol of the rights of the indigenous peoples of our Americas".
Ahead of the news of Morales' departure, the military said it would join Bolivia's overwhelmed police in patrolling the streets, after protesters destroyed at least four police stations amid looting in some areas.
Some Bolivians quickly took to the streets cheering and waving national flags in opposition strongholds like the cities of Santa Cruz and Cochabamba, but angry Morales' supporters tried to reach the Congress building in La Paz screaming, "She must quit!" "I think people are similarly if not more scared this evening", a Western diplomat in the city said, adding that most embassies had been shut with staff working from home.
She spoke after arriving at the legislature in La Paz under heavy guard.
Mr Ebrard said his government viewed Sunday's events in Bolivia as a "coup" because the military broke with the constitutional order by pressing Mr Morales to resign.
The decision came shortly after the Organisation of American States (OAS) found irregularities in a disputed election result in October.
Carlos Mesa, the centrist candidate defeated by Morales in the tainted October 20 presidential elections, tweeted his congratulations to Anez, who has promised a new government would be installed by January 22.
The delayed results of the balloting, which fueled suspicion of vote rigging, showed Morales getting just enough votes to avoid a runoff against a united opposition trying to prevent him from winning a fourth term.
Meanwhile, Mr Morales lashed out at his political opponents, calling it a return to an era of coups overseen by Latin American militaries that long dominated the region.
Pro-Morales protestors marched on the legislature, with succession still in doubt after the vice president and the president of the Bolivian Senate - who were next in line for leadership- also resigned.
A woman prays outside the Cathedral of La Paz, following the announcement of Morales's resignation. The country's Supreme Electoral Court declared that incumbent President Evo Morales won the first round.
In October, he ran for a fourth term and won a heavily scrutinized re-election with a plurality of the vote; because Morales's margin of victory was over 10 points larger than that of Carlos Mesa, the runner-up - thus avoiding a December runoff - the nation's elections board confirmed Morales as the victor of a fourth term.