A Border Patrol truck sits on a hill along the U.S.-Mexico border as the sun sets over Nogales, Ariz. (Jabin Botsford/The Washington Post)

Matthew Bowen thought the U.S. Border Patrol did some important work. Sadly, he told his fellow agents, they just don’t get a fair shake.

In a series of racist and violently worded text messages made public in court filings, Bowen lamented his “failed agency” where, he said, law enforcement officers aren’t given enough resources to do their job — which entails, in Bowen’s words, “hunting down s---bags with your crew.”

“We are treated like s---,” he said in a November 2017 message to another agent. “Prosecuted for doing what it takes to arrest these savages.”

Bowen didn’t know it at the time, but he was days away from encountering one of the very migrants he was disparaging, an incident that would unfold into a years-long investigation and culminate in a criminal trial. It ended this week in Bowen’s forced resignation from the Border Patrol, his guilty plea to a misdemeanor charge and his admission that he intentionally hit a migrant with his truck.

The case against the former agent, and the derogatory remarks it brought to light, is another episode in a summer of scandal for authorities who enforce immigration laws — one already punctuated by revelations of a Facebook group filled with racism and sexism, controversial leaked images from inside a detention facility and the drowning of a father and his 23-month-old daughter who tried to cross the Rio Grande into the United States.

Bowen faces up to a year in prison and $100,000 in fines for deprivation of rights under color of law, his plea agreement states. His sentencing is scheduled for Oct. 15. Bowen’s lawyer, Sean Chapman, declined to comment, and the U.S. attorney’s office in the Arizona district did not respond.

In the court filing, Bowen admits he “intentionally struck [the migrant] with an unreasonable amount of force” and said his actions “were not justified and violated [the migrant’s] rights protected by the Constitution of the United States.”

Documents filed in Tucson’s U.S. District Court over the last 15 months reconstruct the events of that day, Dec. 3, 2017. It began when a U.S. Customs and Border Protection camera operator spotted Antolin Lopez Aguilar, a 23-year-old Guatemalan man they believed had just jumped the border fence near Nogales, Ariz.

As Lopez ran toward a nearby gas station, Bowen chased him in a government-issued Ford F-150 truck. Prosecutors said Bowen “accelerated aggressively” until he was close behind a still-sprinting Lopez. He hit Lopez twice, knocking him down the second time and nearly running him over. Bowen stopped the truck “within inches” of Lopez.

Another border agent later told investigators he had “never seen anything like that before” and said he didn’t think Lopez posed a threat. As Bowen handcuffed Lopez, the second agent noticed cuts on Lopez’s hand and gravel on the side of the man’s face.

Lopez was then charged with unlawful entry into the country and sent by prisoner transport to Tucson, according to court records. Prosecutors say Bowen later filed a false report about what happened that morning.

In the days after, though, Bowen exchanged messages with other agents, downplaying the seriousness of the allegations and complaining about the scrutiny he was under. In the texts, which are laced with more profanity and slurs, he apparently admits to hitting Lopez with his truck.

“Chasing a guat with an f150 and accidentally bumped him at like 7 mph,” he wrote in one.

In another, he said he hit Lopez on purpose to immobilize him.

“Just a little push with a ford bumper,” Bowen wrote.

But it was the messages Bowen sent in the weeks before he ran Lopez down that showed the agent’s “great disdain” for the migrants he policed, prosecutors said. In one message, he called them “mindless murdering savages.”

“PLEASE let us take the gloves off trump!” Bowen wrote. “Disgusting subhuman s--- unworthy of being kindling for a fire."

In one of those exchanges, the 10-year Border Patrol veteran mused about finding a new job.

“Im to the point where there is more negative than positive,” he wrote, “and if I can make a lot more money in a different career field then I feel like I owe it to my family to try and do that.”

Booted from the agency and facing possible prison time, Bowen now has no choice.

Tim Elfrink contributed to this report.

Read more:

ICE agents raid Miss. work sites, arrest 680 people in largest single-state immigration enforcement action in U.S. history

Meet #greenshirtguy — the activist who laughs hysterically at anti-immigration protesters

Panic in Times Square, chaos at another Walmart: Anxiety is through the roof. So are false alarms.