Fourteen Mexican soldiers were detained by US border agents in El Paso, Texas, early Saturday morning for several hours.
They were arrested after accidentally crossing into the United States, Customs and Border Protection (CBP) said.
"Just after midnight today CBP officers working at the Bridge of the America's international crossing in El Paso noted two Mexican military vehicles crossing the boundary and entering the US," the CBP told Reuters in an emailed statement.
According to the CBP, the Mexican soldiers did not realize they had crossed into the US.
"The soldiers, weapons and equipment were secured for safety and processing," CBP said. "The soldiers advised that they did not realize they had entered the US."
Mexican military leadership was contacted and arrived at the port shortly thereafter, it added.
Thirteen of the 14 Mexican soldiers were processed without incident, but one was cited for possessing marijuana for personal use.
They were all returned to Mexico within five hours along with their equipment and vehicles, said the CBP.
Mexico's Defense Ministry did not immediately respond to requests for comment.
Following the incident, the border crossing was closed for about two hours, according to a witness to the events.
"The CBP (agents) yelled at the soldiers to put their hands up and drop their weapons immediately," said the witness, who spoke on condition of anonymity.
The CBP agents searched the vehicles and then escorted away the soldiers, according to the witness and photos of the situation that Reuters saw. The Mexican soldiers appeared to be handcuffed.
This comes after US officials announced Friday that the last remaining of up to 15,000 Haitian migrants had been removed from a squalid makeshift camp under a bridge in Del Rio, Texas.
The area beneath a bridge was the temporary home to Haitians who hoped they would be accepted into the United States.