Mexico said it has cut diplomatic ties with Ecuador after police stormed the country's embassy in Quito on Friday to arrest former Ecuadoran vice president Jorge Glas who was taking refuge there.

Glas sought refuge in the Mexican embassy last December after an arrest warrant was issued against him for alleged corruption, in a move that Ecuadoran President Daniel Noboa's government branded an "illicit act".

Mexico said it had granted political asylum to Glas -- who had served under leftist Rafael Correa between 2013 and 2017 -- "after a thorough analysis" of the situation.

"Police from Ecuador forcibly entered our embassy and detained the former vice president of that country who was a refugee and processing asylum due to the persecution and harassment he faces," President Andres Manuel Lopez Obrador wrote on social media platform X.

"This is a flagrant violation of international law and the sovereignty of Mexico."

Foreign minister Alicia Barcena later wrote on X that Mexico had decided on "the immediate breaking of diplomatic relations with Ecuador."

Ecuador's presidential communications department said in a statement that Glas, who has been "sentenced to imprisonment by the Ecuadoran justice system, has been arrested tonight and placed under the orders of the competent authorities."

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.

On Friday, Mexico had complained of "harassment" due to an increased police presence outside its Quito embassy.