Following a surge in apprehensions of Central Americans trying to enter the United States, Trump last month threatened to close the U.S.-Mexico border if the Mexican government did not stop illegal immigration right away.
Seven men, five women and a child died in the shooting, which occurred close to Minatitlan's oil refinery, one of six run by state oil firm Petroleos Mexicanos (Pemex). Four other people were injured, the state government said in a statement.
Lopez Obrador has tried to persuade Trump to address the problem by fostering economic development in Central America. But on Saturday the US State Department said it was cutting off aid to those three countries.
Migrants illegally crossing the U.S. border have caused persistent bilateral tension ever since Trump launched his bid for the presidency almost four years ago, saying that Mexico was sending rapists and drug runners into the United States.
Tens of thousands of people are registered as disappeared in Mexico, where fighting between drug cartels and their clashes with security forces have been blamed for more than 200,000 deaths since late 2006.
Overdose deaths from opioids have increased almost six-fold in past two decades in the United States, according to the Centers for Disease Control and Prevention. The year 2017 witnessed more than 15,000 deaths due to heroin overdose.