WASHINGTON — When the delegation of congressional democrats arrived in Texas on Monday to tour border facilities holding migrants, they were told in briefing packets and by Customs and Border Protection staff that photos and videos were prohibited — to protect the privacy and safety of those inside.

The group of 14 lawmakers respected those guidelines while in an El Paso facility for children operated by the Department of Health and Human Services, said U.S. Rep. Pete Aguilar, D-Calif.

“We understand protecting kids,” Aguilar said.

But the same understanding did not apply to the two Border Patrol stations in El Paso and Clint, where the lawmakers’ phones were confiscated by CBP, and where Rep. Joaquin Castro, D-Texas, chairman of the Congressional Hispanic Caucus, managed to capture photos and videos on a recording device anyway.

“Our border patrol system is broken. And part of the reason it stays broken is because it’s kept secret,” Castro said on Twitter. “The American people must see what is being carried out in their name.”

He went on to post photos of a dozen migrant women, at least some from Cuba, who sat atop blue sleeping bags on the ground in a small concrete room. In one photo, Ocasio-Cortez is sitting on the ground hugging a woman who had been separated from her daughters and did not know where they were, the congresswoman said.

In a video Castro posted of the same women, which resembles body-camera footage, Ocasio-Cortez can be heard speaking to the women in Spanish.

Though many members in the delegation used their social media platforms to describe with words what they were seeing and hearing, the stealthily captured photos and videos served as a rare window into the Border Patrol stations and detention facilities that the Trump administration has made increasingly difficult to access.

Castro’s visual evidence of the plight inside these facilities also raised questions about why elected government officials are not allowed to have phones inside the border facilities, but border patrol agents are — a disconnect that led to tense moments between CBP staff and some in the congressional delegation.

The media relations office for CBP did not respond to a request for comment.

At their first stop of the day, the El Paso Border Patrol station, the delegation was told to leave their phones in a conference room or with congressional staff while on the tour because people on past congressional visits had allegedly taken unauthorized photos.

Rep. Veronica Escobar, D-Texas, pushed back against that, and later confirmed on Twitter that she raised her voice at El Paso Border Patrol Chief Aaron Hull.

A staffer for Rep. Alexandria Ocasio-Cortez, D-N.Y., said the congresswoman also “spoke sternly” to a CBP officer who “tried to take a stealth selfie” with her “in a mocking manner, despite the gravity of the situation.”

A Washington Examiner report, quoting two unnamed witnesses, claimed Ocasio-Cortez addressed the officer in a “threatening way.” The congresswoman’s staffer called the report an “inaccurate depiction of events.”

Earlier that day, ProPublica had published a report exposing a private Facebook group for U.S. Border Patrol agents called “I’m 10-15,” after the law enforcement code for “aliens in custody.” The group hosted xenophobic and sexist comments, remarks about the death of migrants and sexually explicit images edited to include those of Ocasio-Cortez.

Brian Hastings, chief of operations for Border Patrol, told CNN that they take the Facebook posts “seriously” and said that they “do not represent the thoughts of the men and women of the U.S. Border Patrol.”