The president of the agents’ union said he had received death threats. An agent in South Texas said some colleagues he knew were looking for other federal law enforcement jobs. One agent in El Paso told a retired agent he was so disgusted by scandals in which the Border Patrol has been accused of neglecting or mistreating migrants that he wanted the motto emblazoned on its green-and-white vehicles — “Honor First” — scratched off.

“To have gone from where people didn’t know much about us to where people actively hate us, it’s difficult,” said Chris Harris, who was an agent for 21 years and a Border Patrol union official until he retired in June 2018. “There’s no doubt morale has been poor in the past, and it’s abysmal now. I know a lot of guys just want to leave.”

EDUARDO JACOBO, AN AGENT IN CALIFORNIA’S EL CENTRO SECTOR:

The difference between doing the job now and when I started is like night and day. Before, it was a rush of adrenaline when you caught people with drugs. You were doing more police stuff. Now it’s humanitarian work. If you ask anybody about being in Border Patrol, they’re playing a movie scene in their head, jumping into a burning building and saving people. Now, it means taking care of kids and giving them baby formula.

By and large, the agency has been a willing enforcer of the Trump administration’s harshest immigration policies. In videos released last year, Border Patrol agents could be seen destroying water jugs left in a section of the Arizona desert where large numbers of migrants have been found dead.

Some of those who worked at the agency in earlier years said that it had changed over the past decade, and that an attitude of contempt toward migrants — the view that they are opportunists who brought on their own troubles and are undeserving of a warm welcome — is now the rule, not the exception.

“The intense criticism that is being directed at the Border Patrol is necessary and important because I do think that there’s a culture of cruelty or callousness,” said Francisco Cantú, a former agent who is the author of “The Line Becomes a River,” a memoir about his time in the agency from 2008 to 2012. “There’s a lack of oversight. There is a lot of impunity.”

The Border Patrol was established in 1924. Early agents were recruited from the Texas Rangers and local sheriff’s offices. They focused largely on Prohibition-era whiskey bootleggers, often supplying their own horses and saddles. Though horseback units still exist, the culture of the agency bears little resemblance to its past.

It has become a sprawling arm of Customs and Border Protection, the country’s largest federal law enforcement agency, which is responsible for 7,000 miles of America’s northern and southern borders, 95,000 miles of shoreline and 328 ports of entry. On a practical level, the Border Patrol’s hubs along the Mexican border, known as sectors, operate in some ways as fiefs.