Police officers, using means Mexico described as forcible, arrested on Friday night an Ecuadorean politician who had taken refuge in the Mexican Embassy in Quito, prompting officials to suspend bilateral relations.

The politician, Jorge Glas, a former vice president of Ecuador, had been sentenced to prison for corruption, Ecuador’s presidential office said in a statement, which added that there had been a warrant out for his arrest. Mr. Glas, who had been living at the embassy in Ecuador’s capital since December, was granted political asylum by Mexico earlier Friday.

The office of Ecuador’s president, Daniel Noboa, added that the arrest had gone forward because Mexico had abused the immunities and privileges granted to the diplomatic mission, and that Mr. Glas’s asylum was given “contrary to the conventional legal framework.”

The arrest follows months of dispute between the two nations, in part over Mr. Glas, whom Ecuadorean authorities considered a fugitive. Both sides have been trading barbs, with tensions escalating this past week after the Mexican president appeared to question the legitimacy of Ecuador’s most recent presidential election.

Mexico’s secretary of foreign affairs, Alicia Bárcena Ibarra, announced the breaking of diplomatic relations with Ecuador in a statement, saying that Mexican diplomatic personnel had suffered injuries in the episode at the embassy. She ordered Mexican diplomats to leave Ecuador and said Mexico would file an appeal to the International Court of Justice.

And shortly after the arrest, Mexico’s president, Andrés Manuel López Obrador, issued a statement calling the episode a “flagrant violation of international law and the sovereignty of Mexico,” and saying that the Ecuadorean police had used force to enter the embassy.