Emails reviewed by The Wall Street Journal show agents with the Immigration and Customs Enforcement agency crafted a plan in 2010 to use license plates readers—devices that record the plate numbers of all passing cars—at gun shows in Southern California, including one in Del Mar, not far from the Mexican border.

Agents then compared that information to cars that crossed the border, hoping to find gun smugglers, according to the documents and interviews with law-enforcement officials with knowledge of the operation.

The investigative tactic concerns privacy and guns-rights advocates, who call it an invasion of privacy. The law-enforcement officials say it is an important and legal tool for pursuing dangerous, hard-to-track illegal activity.

There is no indication the gun-show surveillance led to any arrests or investigative leads, but the officials didn’t rule out that such surveillance may have happened elsewhere. The agency has no written policy on its use of license plates readers and could engage in similar surveillance in the future, they said.

Jay Stanley, a lawyer at the American Civil Liberties Union, said the gun-show surveillance “highlights the problem with mass collection of data.” He said law enforcement can take two entirely legal activities, like buying guns and crossing the border, “and because those two activities in concert fit somebody’s idea of a crime, a person becomes inherently suspicious.”

Erich Pratt, executive director of Gun Owners of America, said his group also opposes such surveillance. “Information on law-abiding gun owners ends up getting recorded, stored, and registered, which is a violation of the 1986 Firearm Owners Protection Act and of the Second Amendment,” Mr. Pratt said.

Federal agency and local police are scanning license plates at gun shows.

Agents then compared the gun-show-plate data to cars that crossed the border, hoping to find gun smugglers, according to the documents and interviews with law-enforcement officials.

A spokeswoman for ICE acknowledged its Homeland Security Investigations agents in San Diego office conducted an operation at the Del Mar gun show. “In conducting these operations, HSI San Diego and its partners make every effort to utilize all investigative methods for planning purposes,” she said. “As for specific methods, HSI San Diego does not comment.”

John Chigos, CEO of PlateSmart Technologies, Inc., which sells license plates reader systems, said the devices help protect the public but he called it “an abuse of the technology’’ to target gun-show shoppers.

He added, “I think this was a situation that shows we need to establish policies for license-plate readers, like any new technology.”

But their use at gun shows occupies a murky legal ground. While technology and data collection have greatly expanded the ability of government and companies to monitor citizens’ activity, U.S. courts, lawmakers, and senior officials have been slow to make clear what types of mass surveillance cross the line into violations of constitutional rights.

It has long been legal for police officers to record license plates they observe in the course of ordinary life. License-plate-reader technology, however, allows those observations to become mass-data collection. A single camera can record thousands of vehicle plates an hour, capturing the data at high speeds, in thick traffic and in other situations that the human eye cannot.

Boosters of the technology say it is a way to find a criminal in a sea of otherwise indistinguishable cars. Critics say that to find that criminal the government is tracking the movements of millions of innocent people—adding up to detailed surveillance of their daily lives and creating data that can be misused.

Critics such as Mr. Pratt say using the technology for gun shows is illegal in any case because of the firearm owners act, which bans the government from creating records of gun buyers except temporarily for background checks.

The Journal obtained, through a request under the Freedom of Information Act, internal ICE emails showing agents in 2010 targeted a gun show called Crossroads of the West in Del Mar, Calif.

More than half of the pages provided by the agency were completely redacted, or blacked out; others have large sections redacted, apparently to keep secret how the surveillance was undertaken.

In an email titled “Request for Assistance,” an ICE investigator wrote, “We would like to see if you can support an outbound guns/ammo operation on (redacted) at the Crossroads (Del Mar) Gun Show. We would like to deploy license plate readers.” The email, whose sender and recipient are redacted, includes a large section of operational details that are also redacted.

The law-enforcement officials with knowledge of the operation confirmed ICE got local police officers to drive around the parking lot at the gun show and use their license-plate readers to collect all of the cars’ information. A spokeswoman for the San Diego County Sheriff’s Office declined to comment on whether the department took part in the activity.

Bob Templeton, the CEO of Crossroads of the West, which puts on the gun show, said he knew local police had been at the show, but was surprised to learn that federal agents had been gathering data about customers. The show at the Del Mar Fairgrounds typically draws 6,000 to 9,000 customers, meaning thousands of cars are in the parking lot, he said.

“It’s obviously intrusive and an activity that hasn’t proven to have any legitimate law-enforcement purpose,” said Mr. Templeton. “I think my customers would be resentful of having been the target of that kind of surveillance.”

Other emails show ICE agents planned to keep scanning license plates at other gun shows in Southern California, though agency officials said they couldn’t confirm whether they had done so.

A June 30, 2010, email from an ICE agent lists a series of gun shows that summer, including ones in nearby Ontario and Costa Mesa, noting that “the last (only) one worked out pretty well, so I’d like to send two or three to that one as well.”

In reply, an unidentified agent wrote, “I am good to go on all of them.”