Fourteen Mexican army soldiers were briefly detained and then returned to Mexico after they crossed into the U.S. at a border bridge in El Paso, Texas.

U.S. Customs and Border Protection said in a statement that two Mexican military vehicles crossed the bridge that links El Paso to Ciudad Juarez, Mexico in the early hours of Saturday.

CBP said the soldiers, their weapons and equipment "were secured for safety and processing," and noted the soldiers said "they did not realize they had entered the U.S."

U.S. Customs and Border patrol agents on all-terrain vehicles look over over the Mexico- U.S. border wall where it enters the Pacific Ocean at Border Field State Park in San Diego, California, U.S., November 18, 2017. REUTERS/Mike Blake - RC1A9C0A7F90

14 Mexican soldiers, one with marijuana, crossed the U.S.-Mexican border through the bridge that connects El Paso, Texas to Juarez, Mexico. (REUTERS)

ACTING CBP CHIEF 'SHOCKED' BY IMAGES OF BORDER PATROL ON HORSES, AS ADMINISTRATION DOUBLES DOWN

One of the Mexican soldiers "was assessed a civil penalty after CBP officers discovered a personal use amount of marijuana in his possession," according to CPB.

All 14 soldiers, their equipment and vehicles were returned to Mexico a few hours later after Mexican army officers arrived for them.

Photos posted on social media showed about a half dozen Mexican army soldiers in full tactical gear sitting on the side of the road by a border bridge. It was unclear if they were handcuffed.

CLICK HERE TO GET THE FOX NEWS APP

Mexico's Defense Department did not immediately respond to requests for comment.

Inadvertent crossings of the border by Mexican military forces have occurred in the past, but usually in areas where the border is not clearly marked, not at major border crossing bridges.