Former Bolivian President Evo Morales has left Mexico for political asylum, as the military pledged to help police cope with violence after the president's sudden resignation caused a power vacuum.

Morales, 60, called Mexican Foreign Minister Marcelo Ebrard on Monday to seek asylum, and Ebrard confirmed that his country had agreed to grant Morales asylum.

He announced late on Monday that a Mexican military plane with the former president aboard "has taken off ... with Morales on board." According to international treaties, under the protection of Mexico, his life and safety have been saved.

"It is painful to leave the country for political reasons, but I will stay in touch," the former president tweeted on Twitter.

Opposition Deputy Speaker Janine Anniz, who will take over as interim president, vowed to hold elections to end the political crisis.

Keeping security
The events came a day after Morales suddenly resigned after losing army support following three weeks of mass protests against his victory in the controversial election for a fourth unconstitutional term.

"The military command of the armed forces arranged for joint operations with the police to prevent bloodshed and fighting within the Bolivian family," General William Caliman said in a televised address.

Earlier, La Paz police chief Jose Parenicia called on General Caliman to "intervene because Bolivian police have seen abuses". Three people have been killed in clashes since the disputed election.

Morales announced his resignation on Sunday in a televised speech, and the celebrations immediately spread the streets of La Paz and waved the protesters in joy with their country's flags.

Morales accused opposition leaders Mesa and Luis Fernando Camacho of "racism" and of "planning a coup".

The United Nations and the Organization of American States feared security chaos in the country when dozens of officials and ministers resigned and some took refuge in foreign embassies.