The two Marines pulled over on an exit ramp along a desolate desert highway in Southern California this month, and opened a back door of their black BMW just long enough for three people to rush from the thorny scrub into the back seat.

They were about a mile from the southern border, where thousands of troops have deployed this year to try to stem the flow of migrants — but the authorities say the Marines in the BMW had the opposite aim. According to a federal criminal complaint, they planned to make some easy money by taking their passengers, migrants from Mexico, to the next stop on their smuggling route north.

Instead, they were pulled over minutes later and arrested by Border Patrol agents. That stop on July 3 led this week to the arrest of 16 other Marines suspected of human smuggling and drug violations, pointing to a much broader operation that reached deep into the enlisted ranks.

Those Marines — from Camp Pendleton, near Oceanside, Calif. — have not yet been charged. But their arrests are a glaring indication that stepped-up enforcement at the border by both troops and Border Patrol agents has done little to stop migrants, and has instead had an unintended effect: pushing up smuggling fees and attracting atypical players to the trade.