The president made his remarks during a regular press conference, addressing fears that designating groups as foreign terrorist organizations could lead to unilateral US action against gangs.
"Since 1914 there hasn't been a foreign intervention in Mexico and we cannot permit that," Lopez Obrador said, referring to the US occupation of the port of Veracruz 105 years ago.
"Armed foreigners cannot intervene in our territory," he said, instead offering more cooperation with the United States on fighting drug gangs, which have shown their power in a series of battles with security forces and civilians in recent months.
Trump has repeatedly offered military assistance to help combat the cartels, with Mexico declining such an offer. Mexico's foreign minister said earlier that US Attorney General William Barr will visit Mexico next week to discuss further security cooperation. The planned Barr visit will be the highest-level meeting since a gangland massacre of a US-Mexican family which led to the US President’s plan.
"What we need to address organized crime is more mutual cooperation, not elements that will put distance between us or create hostilities ... We're obliged to give our societies results and to that end we need cooperation," Ebrard said.