Updated

The U.S. government kept a database on journalists, activists, organizers and "instigators" during an investigation into last year's migrant caravan from Mexico, infuriating civil liberties and media groups.

U.S. Customs and Border Protection kept the information that contained passport photos, date of birth, suspected role in the caravan and whether they had been arrested, the San Diego TV station KNSD reported Wednesday.

Some of the people listed in the Homeland Security documents provided to the station included 10 journalists, seven U.S. citizens, a U.S. attorney and 47 people from Central America. Some of the people on the list were denied entry into Mexico and had their passports flagged.

The intelligence-gathering efforts were done under the umbrella of "Operation Secure Line," which was designed to monitor the caravan of thousands of people who began making their way north from Central America late last year to seek asylum in the United States.

The government compiled the database at a time when the caravan was attracting considerable attention in the White House around the time of the midterms, with President Trump repeatedly tweeting about the group.

Customs and Border Protection officials didn't dispute the database, saying in a statement to The Associated Press that extra security followed a breach of a border wall in San Diego on Nov. 25 in a violent confrontation between caravan members and border agents. The confrontation closed the nation's busiest border crossing for five hours on Thanksgiving weekend.

Officials said it was protocol to follow up on such incidents to collect evidence, and determine whether the event was orchestrated.

Such "criminal events ... involving assaults on law enforcement and a risk to public safety, are routinely monitored and investigated by authorities," the statement said.

The statement didn't address specifics of why journalists would be on the list to have their passports flagged.

The American Civil Liberties Union condemned the operation.

"This is an outrageous violation of the First Amendment," attorney Esha Bhandari said. "The government cannot use the pretext of the border to target activists critical of its policies, lawyers providing legal representation, or journalists simply doing their jobs."

The Committee to Protect Journalists called on Congress to investigate what it called a "disturbing pattern of activity," and representatives from the organization plan to meet with Customs and Border Protection officials to discuss the situation.

The documents, dated Jan. 9, are titled "San Diego Sector Foreign Operations Branch: Migrant Caravan FY-2019, Suspected Organizers, Coordinators, Instigators and Media." According to the station, the material was used by Homeland Security and other agencies, including some San Diego FBI agents.

Two freelance photojournalists confirmed to the station that the information in their dossiers was accurate. Both were pulled in for secondary questioning at border crossings and one, Kitra Cahana, eventually was stopped in Mexico, denied entry and had to fly back to the U.S. They were not told why they were targeted.

One dossier was on Nicole Ramos, the refugee director and attorney for Al Otro Lado, a law center for migrants and refugees in Tijuana, Mexico. It included details such as the kind of car she drives and her mother's name, KNSD-TV reported.

"The document appears to prove what we have assumed for some time, which is that we are on a law enforcement list designed to retaliate against human rights defenders who work with asylum seekers and who are critical of CBP practices that violate the rights of asylum seekers," Ramos told the station by email.