Ecuador has faced international criticism after storming the Mexican embassy in Quito to arrest former Vice President Jorge Glas, who was seeking asylum there.
Mexico has responded by suspending diplomatic ties and plans to file a case against Ecuador at the International Court of Justice.
The incident, which Mexico views as a violation of international law and sovereignty, has shocked the region and drawn condemnation from Latin American leaders.
Diplomatic tensions between Mexico and Ecuador escalated this week, resulting in the detention and transfer of Mexican diplomat, Jorge Alberto Glas, to a maximum-security prison in Ecuador.
Glas, 54, is currently appealing his unlawful detention, but a ruling from the judge is yet to be made.
In response, the Mexican embassy staff and their families have returned to Mexico City.
The group of 18 people left Ecuador on a commercial flight on Sunday.
The reasons for Glas' detention and the diplomatic provocations leading up to it have not been disclosed by Ecuadorian authorities.
Mexican officials were accompanied by diplomats from friendly countries at the Quito airport.
Mexico's embassy and consular services in Ecuador have been closed indefinitely, but Mexicans can still get help through a communications system and Mexican embassies in Chile, Colombia, and Peru.
The closure comes after Ecuadorian authorities accused Mexican ex-official Rodrigo Glas, who served under former President Rafael Correa, of embezzling earthquake rebuilding funds.
Glas has been convicted twice on corruption charges.
Mexican diplomat Alexandro Glas faces allegations of involvement in drug trafficking and money laundering, which he denies.
Following his arrest in Ecuador, several Latin American countries, including Brazil, Argentina, and Nicaragua, condemned Ecuador for the arrest and accused them of violating the Vienna Convention on Diplomatic Relations and Glas's right to asylum.
Argentina and Colombia called for the full observance of the Vienna Convention, while Colombia's President Gustavo Petro described Glas's right to asylum as having been "barbarically violated." Honduras also severed diplomatic ties with Ecuador over the incident.
United Nations Secretary-General
António Guterres expressed alarm over the raid on the Mexican embassy in Quito, Ecuador, where Fidel Narváez Glas, a Mexican businessman wanted in a corruption probe, had taken refuge.
Spokesperson Stéphane Dujarric reiterated the principle of inviolability of diplomatic premises and personnel.
Ecuadorian Foreign Minister Gabriela Sommerfeld defended the raid, citing a risk of imminent escape and accusing Mexico of violating the non-intervention principle by harboring Glas.
Video footage showed police officers surrounding the embassy with some carrying weapons.
Ecuador's representative rejected Mexico's argument that a convicted criminal named Glas was being politically prosecuted.
According to the Ecuadorian stance, a person cannot be considered politically persecuted if they have been convicted with an enforceable sentence and have an arrest warrant issued by the judicial authorities.