Ecuadoran authorities stormed the Mexican embassy in Quito on Friday to arrest former vice president Jorge Glas, who was taking refuge there, prompting Mexico to sever diplomatic ties after the "violation of international law".
Images taken by AFP showed police special forces massed outside the embassy and at least one of them scaling its walls, which were already surrounded by police and military.
Mexican President Andres Manuel Lopez Obrador said authorities "forcibly entered" the building to arrest Glas.
"This is a flagrant violation of international law and the sovereignty of Mexico," he said on social media platform X.
Foreign minister Alicia Barcena later wrote on X that "given the flagrant violation of the Vienna Convention on Diplomatic Relations and the injuries suffered by Mexican diplomatic personnel in Ecuador, Mexico announces the immediate breaking of diplomatic relations with Ecuador."
She added that Mexican diplomatic personnel will immediately leave the South American country and asked Quito to "offer the necessary guarantees" for their movement.
Mexico had complained earlier in the day of "harassment" due to an increased police presence outside its Quito embassy.
The former Ecuadoran vice president -- who served under leftist President Rafael Correa -- sought refuge in the Mexican embassy last December after authorities issued a warrant for his arrest for alleged corruption.
But his asylum request was formally granted on Friday, angering Quito and deepening the diplomatic dispute between the two Latin American nations.
Ecuadoran President Daniel Noboa's government calling the move an "illicit act".
Mexico said it had granted political asylum to Glas "after a thorough analysis" of the situation.
Ecuador's presidential communications department said in a statement that Glas, "has been arrested tonight and placed under the orders of the competent authorities."
Local media showed Roberto Canseco, head of the Mexican diplomatic mission, running behind vehicles believed to be transporting Glas from the site, shouting: "It's an outrage!"
Agents prevented Canseco from approaching one of the cars and in the ensuing struggle he is seen falling to the ground.
Earlier on Friday, Ecuador said that according to international conventions, "it is not legal to grant asylum to people convicted or prosecuted for common crimes and by competent ordinary courts."
Lopez Obrador had irked Quito a day before Mexico granted the asylum request with comments equating political violence in the two countries.
On Wednesday he drew a comparison between 2023 election violence in Ecuador, in which a presidential candidate was murdered, and crime in Mexico ahead of the June 2 legislative and presidential elections.
Lopez Obrador said violence and "manipulation" by some media caused a drop in the popularity of leftist candidate Luisa Gonzalez and the rise of Noboa.
The Ecuadoran government criticized his comments as offensive and said the country was still in "mourning" for the slain candidate, Fernando Villavicencio, a fierce opponent of corruption.
Glas was released from prison in November after serving time for corruption in a vast scandal involving the Brazilian construction giant Odebrecht.
He faces another arrest warrant for allegedly diverting funds that were intended for reconstruction efforts after a devastating earthquake in 2015.