President Trump said Wednesday that Mexican troops who drew guns on U.S. soldiers at the border last week were "probably" a diversion for drug smugglers, a theory at odds with the U.S. military’s assessment of what happened.

Trump’s tweeted thoughts included a warning to Mexico.

“Mexico’s Soldiers recently pulled guns on our National Guard Soldiers, probably as a diversionary tactic for drug smugglers on the Border,” the president wrote, erroneously calling the soldiers National Guardsmen. “Better not happen again! We are now sending ARMED SOLDIERS to the Border. Mexico is not doing nearly enough in apprehending & returning!”

The tweet refers to an incident on April 13 in which two active-duty U.S. soldiers involved in the Defense Department’s mission to provide camera surveillance at the border were briefly detained and disarmed on U.S. soil, U.S. military officials said.

Navy Capt. Pamela Kunze, a U.S. military spokeswoman, said in an email that five to six members of the Mexican military approached and questioned the U.S. soldiers, who were near Clint, Tex., in an unmarked vehicle owned by Customs and Border Protection.

“An inquiry by CBP and DOD revealed that the Mexican military members mistakenly believed the U.S. Army soldiers were south of the border with Mexico,” Kunze wrote. “However, the U.S. soldiers were appropriately in U.S. territory. Though they were south of the border fence, U.S. soldiers remained in U.S. territory, north of the actual border.”

The Mexican military departed the area after “a brief discussion between the soldiers from the two nations,” she said.

“We believe this brief exchange was a misunderstanding concerning the location of the unmarked U.S. surveillance vehicle and an honest mistake by the Mexican soldiers,” Kunze said. “The Mexican military has been and continues to be a great partner with the United States military.”

The incident was first reported Friday night by Newsweek, which cited a U.S. military report that Mexican soldiers told one of the American soldiers to put his M9 pistol inside the CBP vehicle.

The Mexican Foreign Ministry released a statement Wednesday downplaying the incident. Officials said a group of Mexican military officers in Ciudad Juarez encountered two U.S. soldiers on April 13 “doing support work in a vehicle with no identification that was south of the border fence, within U.S. territory, in an area in which the border demarcation isn’t clear because of geography.”

“After an investigation, a decision was reached to move the U.S. military vehicle north of the border fence to avoid confusion,” the statement said. “This type of incident is common, as it involved verification of an ordinary patrol, and there were no consequences for either of the two governments, which maintain constant, fluid communication. In this particular incident, they were in direct, efficient contact."

The incident highlights the possible confusion in an evolving and growing mission in which about 3,000 active-duty service members and 2,000 National Guard members are assisting CBP at the border at Trump’s direction.

The confrontation also draws attention to the actions of Mexican authorities at the border. U.S. officials have reported instances in which Mexican soldiers have come over the U.S. border for years. In some cases, they are characterized as accidents, but there also are instances in which smugglers have been discovered wearing Mexican army uniforms.

The Los Angeles Times, citing internal documents it obtained, reported in 2014 that U.S. officials had documented nearly two dozen border incursions by Mexican troops in the previous four years. Some U.S. officials have questioned whether some of them have provided security to drug smugglers.

Brandon Judd, the national president of a union for Border Patrol agents, said in an interview on Fox News Channel’s “Fox and Friends” on Sunday that he questioned the explanation U.S. officials provided about the most recent incident.

“I don’t know one Border Patrol agent that will accept that story that the Mexican military thought these National Guardsmen were in Mexico,” said Judd, who also erroneously stated that the Americans were members of the National Guard. “We have case after case after case where it is believed that Mexican military is performing diversion tactics for criminal cartels in order for them to smuggle drugs or high-value contraband into the United States.”

Judd, who leads the National Border Patrol Council, said that “there were many crimes committed by the Mexican military,” and that the evidence in “all of the different incursions” by the Mexican military “clearly points” to the Mexican soldiers being involved with drug traffickers.

“It’s amazing,” Fox host Pete Hegseth said in response. “And I absolutely believe it, based on covering this, as you said, for the last couple of years.”

The incident has prompted some prominent conservatives to question whether the U.S. soldiers did anything wrong.

“Have these soldiers been court-martialed yet?" Ann Coulter tweeted on Sunday night.

But Kunze, the U.S. military spokeswoman, indicated that the soldiers did nothing wrong.

“Throughout the incident, the U.S. soldiers followed all established procedures and protocols and, through communication, successfully de-escalated the situation,” she said in her email.

Trump’s tweet Wednesday threatened to send armed U.S. soldiers to the border, but some American forces there already are. In most circumstances, a soldier in a military police role is armed and watches out for fellow soldiers nearby.

It was not immediately clear whether the Pentagon is arming more or all U.S. troops at the border.

“We are continually reviewing and adapting our processes, training and procedures as we support CBP in the southwest border security mission,” Kunze wrote. “The U.S. soldiers involved in this incident responded appropriately in de-escalating the situation and notifying their Border Patrol counterparts as they have been specifically trained to do.”

Mexican President Andrés Manuel López Obrador said on Wednesday that he had seen Trump’s tweet on the military confrontation and was looking into the issue.

“We are going to look into this case, taking into account what’s been said, and providing assurances that we will always act responsibly with the people and government of the United States,” López Obrador told a morning news conference.

Trump also tweeted erroneously on Wednesday that a caravan of 20,000 migrants had arrived in Mexico, and he urged Mexican authorities to detain the group. While Mexican officials had worried in recent weeks about reports that the “mother of all caravans” was forming in from Central America, a group of that size never arrived in the country.

López Obrador is a leftist who has vowed a more humane policy toward irregular migration. But he has also sought to avoid getting into fights with Trump.

“The most important thing is to tell him (Trump) that we are not going to fight with the government of the United States, we want a relationship of mutual respect and cooperation in development, and that’s what we have sought in these months, we are going to continue acting to maintain relations that are cordial and neighborly,” said the Mexican president.

“We are not going to be tripped up by any provocation, I say to President Donald Trump that we want to maintain a respectful, friendly relationship with his government, that we will investigate this incident (regarding the military on the border), that we will take into account what he is saying, and we will act according to our laws, and respecting our sovereignty.”

Sheridan reported from Mexico City.

This story was originally published at 10:09 a.m. and updated with additional reporting and context.