Ecuador and Mexico are two nations that share a common history by being both once part of the Spanish Empire. In 1819, Ecuador was part of the Gran Colombia. After its break up, Mexico recognized and established diplomatic relations with Ecuador in June 1830. In 1837, Mexico opened a consulate in Guayaquil which subsequently became its first diplomatic mission in South America. Diplomatic relations between the two nations began to significantly develop in the 1970s. In 1974, Mexican PresidentLuis Echeverría paid a state visit to Ecuador and met with President Guillermo Rodríguez. The two leaders signed several agreements on economic, scientific and cultural cooperation. Since then, there have been numerous high level visits between leaders of both nations to each other's country. For several years, Mexico has been returning Ecuadorian nationals without proper documentation on their way to the United States to Ecuador. Since 2006, drug traffickers and Central American gangs have increased their attacks on migrants transiting through Mexico. As a result, both Ecuador and Mexico have increased cooperation to provide better protection and consular support to hundreds of Ecuadorian migrants who traverse Mexico each year. In December 2018, Ecuadoran President Lenín Moreno arrived to Mexico to attend the inauguration of Mexican President Andrés Manuel López Obrador.
Both nations have signed several bilateral agreements such as a Treaty of Friendship, Commerce and Navigation; Cultural Exchange Agreement; Agreement of Cooperation to Combat Drug Trafficking and Drug Dependency; Agreement on Scientific and Technical Cooperation; Tourist Cooperation Agreement; Agreement to Avoid Double Taxation and Prevent Tax Evasion on Income subject to Tax; Agreement on Air Transportation; Agreement on Legal Assistance in Criminal Matters; Extradition Treaty and an Agreement on Mutual Recognition of Higher Education Studies issued by both nations.
In 2018, two-way trade between both nations totaled US$850 million. Ecuador's main exports to Mexico include: cocoa, sardines, crude oil, jelly, coffee, asparagus and mangoes. Mexico's main exports to Ecuador include: shampoos, flat screens TVs, tractors, body deodorants and antiperspirants; and dentifrices. Mexico is the largest foreign investor in Ecuador. Between 2008-2017, Mexican companies invested US$1.4 billion in Ecuador. Mexican multinational companies such as América Móvil, Cemex, FEMSA, Grupo Bimbo, Mabe, Mexichem and OXXO operate in Ecuador.