One US Border Patrol agent in Tucson, Arizona, said he had been called a “sellout” and a “kid killer”.

In El Paso, Texas, an agent said he and his colleagues in uniform had avoided eating lunch together except at certain “BP friendly” restaurants because “there’s always the possibility of them spitting in your food”.

An agent in Arizona quit last year out of frustration. “Caging people for a nonviolent activity started to eat away at me,” he said.

For decades, the Border Patrol was a largely invisible security force. Along the southwestern border, its work was dusty and lonely.

Between adrenaline-fuelled chases, the shells of sunflower seeds piled up outside the windows of their idling pickup trucks. Agents called their slow-motion speciality “laying in” – hiding in the desert and brush for hours, to wait and watch, and watch and wait.

'Dangerous' overcrowding of migrants in US border facilities Show all 6 1 /6 'Dangerous' overcrowding of migrants in US border facilities 'Dangerous' overcrowding of migrants in US border facilities Photos of detained migrants crowded into cells at the US border - with one holding up a sign reading simply "help" - have been released as part of a new report warning of "dangerous" overcrowding. The memo was sent to the Department of Homeland Security by its Inspector General, containing photos taken at border facilities in the Rio Grande Valley over a week in June DHS/OIG 'Dangerous' overcrowding of migrants in US border facilities Eighty-eight adult males held in a cell with a maximum capacity of 41, some signalling prolonged detention to OIG Staff on June 12 DHS/OIG 'Dangerous' overcrowding of migrants in US border facilities Overcrowding of families observed by OIG on June 11, at a border patrol facility in Weslaco, Texas DHS/OIG 'Dangerous' overcrowding of migrants in US border facilities Migrant families overcrowding a border patrol facility on June 11 in McAllen, Texas DHS/OIG 'Dangerous' overcrowding of migrants in US border facilities Fifty-one adult females held in a cell designated for male juveniles with a capacity for 40 at Border Patrol’s Fort Brown Station DHS/OIG 'Dangerous' overcrowding of migrants in US border facilities Migrant families overcrowding a border patrol facility on June 11 in McAllen, Texas DHS/OIG

Two years ago, when Donald Trump entered the White House with a pledge to close the door on illegal immigration, all that changed. The nearly 20,000 agents of the Border Patrol became the leading edge of one of the most aggressive immigration crackdowns ever imposed in the United States.

No longer were they a quasi-military organisation tasked primarily with intercepting drug runners and chasing smugglers.

Their new focus was to block and detain hundreds of thousands of migrant families fleeing violence and extreme poverty – herding people into tents and cages, seizing children and sending their parents to jail, trying to spot those too sick to survive in the densely packed processing facilities along the border.

Ten migrants have died since September in the custody of the Border Patrol and its parent agency, Customs and Border Protection.

In recent months, the extreme overcrowding on the border has begun to ease, with migrants turned away and made to wait in Mexico while their asylum claims are processed.

The Border Patrol, whose agents have gone from having one of the most obscure jobs in law enforcement to one of the most hated, is suffering a crisis in both mission and morale.

Earlier this year, the disclosure of a private Facebook group where agents posted sexist and callous references to migrants and the politicians who support them reinforced the perception that agents often view the vulnerable people in their care with frustration and contempt.

Seesaws installed at US border wall so American and Mexican children can play together

Interviews with 25 current and former agents in Texas, California and Arizona – some conducted on the condition of anonymity so the agents could speak more candidly – paint a portrait of an agency in a political and operational quagmire.

Overwhelmed through the spring and early summer by desperate migrants, many agents have grown defensive, insular and bitter.

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 – “Honour 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.”

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 last decade, and that an attitude of contempt towards 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.”

In El Paso and other border communities, becoming an agent has long been viewed as a ticket to the middle class. A starting agent with a high school diploma and no experience can expect to earn $55,800 (£44,800), including overtime, climbing to $100,000 (£80,200) in as few as four years.

The Independent goes on a ride-along with US Border Patrol Show all 15 1 /15 The Independent goes on a ride-along with US Border Patrol The Independent goes on a ride-along with US Border Patrol Texas and Mexico are connected by entry points like these. US Border Patrol in Laredo, Texas conducts daily patrols throughout the Rio Grande, snaking between the US and Mexico, where it searches for migrants and drug traffickers. The legal entry point to Mexico can be seen above the riverines frequently used by cartels to funnel narcotics into the US. Chris Riotta The Independent goes on a ride-along with US Border Patrol US Customs and Border Protection oversees its side of the entry point. US Customs and Border Protection officers oversee the processing of nearly two million trucks and three million pedestrians annually at the Laredo sector, which also processes the majority of trade between the US and Mexico. Chris Riotta The Independent goes on a ride-along with US Border Patrol The Rio Grande snakes between Mexico and the United States. The US and Mexico have bordering coastlines in Laredo Texas, where the Rio Grande's occasionally rough currents splash onto both nations' shores. For migrants attempting to enter into either country, the swim is much more dangerous than it appears. Chris Riotta The Independent goes on a ride-along with US Border Patrol Drug traffickers and migrants use "highways" to cross the border. US Border Patrol agents call worn pathways like these "highways," as they are frequently used by drug traffickers and migrants entering into the US. Chris Riotta The Independent goes on a ride-along with US Border Patrol The journey is still far from over. If they're able to make it onto land, many obstacles still remain for migrants and drug traffickers. US Border Patrol agents are equipped with high-tech security, K-9 units and aerial camera footage surveilling 40 miles of borderlands. Chris Riotta The Independent goes on a ride-along with US Border Patrol Border Patrol uses classic methods and high-tech to surveil the border. A control room at the Laredo sector headquarters is fully-manned 24/7 with a team of local employees who alert agents on the ground of border crossings in real-time. Their cameras live-stream 40 miles of the 170 mile territory the sector covers. Chris Riotta The Independent goes on a ride-along with US Border Patrol The US provides trusted traveler programs on both its southern and northern borders. Officers lead the way to Sentri offices, which runs a trusted traveller program from US and Mexican local residents who regularly cross the border for work or leisure purposes. Chris Riotta The Independent goes on a ride-along with US Border Patrol The pathway to freedom. Once travellers are processed, they walk up this ramp towards the US. Many Mexicans cross the border each day with collapsable shopping carts to buy goods while visiting the country. Chris Riotta The Independent goes on a ride-along with US Border Patrol But first, the wait. A dog waits for their owner to go through processing with US Customs and Border Patrol. On a good day, processing can take under an hour. On a bad day, well, there's just no telling how long one might be stuck inside the Laredo sector field offices. Chris Riotta The Independent goes on a ride-along with US Border Patrol The first lady of CBP. Inside the Laredo field offices, US Border Patrol agents keep a framed photo of Christine Davis, the first female agent to join the federal agency in 1975. Chris Riotta The Independent goes on a ride-along with US Border Patrol "The hall of fame." US Border Patrol also honors those who have served in the agency for over thirty years. Chris Riotta The Independent goes on a ride-along with US Border Patrol Officers inspect a vehicle in secondary processing. Outside, officers are conducting secondary inspection on a vehicle that's been pulled aside for further investigating. Chris Riotta The Independent goes on a ride-along with US Border Patrol The waiting room for detained migrants. A US Customs and Border Protection officer shows the inside of a holding room where people requiring further questioning go through secondary processing. Chris Riotta The Independent goes on a ride-along with US Border Patrol A man and his daughter go through processing. US Customs and Border Protection also regularly provides humanitarian visas and other temporary permissions for people with valid reasons seeking entry to the US. Here, a father and his daughter await to see whether they will be provided one of those visas. Chris Riotta The Independent goes on a ride-along with US Border Patrol Laredo processes over three million pedestrians annually. Thousands of legal asylum seekers, migrants and refugees seek entry to the US through the southern border annually, where they go through processing at offices like this after arriving at a legal port of entry. For many, the trip can take days, if not weeks or even months. Chris Riotta

But given the long, solitary work, often in punishing heat and far-flung locations, and a growing workload, the agency has had difficulty recruiting: it remains about 1,800 agents short of its earlier hiring targets.

Some trace the increasing bitterness and frustration among agents to 2014, when large numbers of migrant families, as well as unaccompanied children, began arriving at the border.

Many agents said they were not given the money or infrastructure to handle the emerging crisis. Desperate mothers and sick children had to be herded into fenced enclosures because there was nowhere else to put them.

Some agents blamed migrant parents for bringing their children into the mess.

Their anger began building under Barack Obama’s presidency. Then, with Mr Trump’s election, it found a voice in the White House.

UK news in pictures Show all 50 1 /50 UK news in pictures UK news in pictures 18 September 2020 A model presents a creation during the Bora Aksu catwalk show at London Fashion Week 2020 Reuters UK news in pictures 17 September 2020 World kickboxing champion Carl Thomas during his attempt to run a marathon while pulling a plane at Elvington Airfield near York. The attempt is raising funds for Ollie's Army Battling Against Battens, an organisation campaigning to raise GBP 250,000 to fund a clinical trial aimed at saving the sight of children with CNL2 Batten Disease PA UK news in pictures 16 September 2020 Labour deputy leader Angela Rayner speaking during Prime Minister's Questions UK Parliament/AFP/Getty UK news in pictures 15 September 2020 People enjoying the autumn sunshine as they punt along the River Cam in Cambridge PA UK news in pictures 14 September 2020 Early morning light bathes the skyscrapers of the City of London, at the start of a week in which the UK is expected to bask in temperatures of more than 30 degrees PA UK news in pictures 13 September 2020 England celebrate after they dismissed Australia's Alex Carey to win the second ODI match of the series at Emirates Old Trafford, Manchester PA UK news in pictures 12 September 2020 Protesters outside BBC Broadcasting House in central London, as marches and rallies form across the country calling for a 15% pay rise for NHS workers and an increase in NHS funding PA UK news in pictures 11 September 2020 An empty migrant dinghy floats off the beach at St Margaret's Bay after the occupants landed from France in Dover Getty UK news in pictures 10 September 2020 A view of small boats thought to be used in migrant crossings across the Channel at a storage facility in Dover, Kent PA UK news in pictures 9 September 2020 EU's chief negotiator Michel Barnier, left, arriving from the Eurostar with EU Ambassador to the UK, Portuguese diplomat Joao Vale de Almeida at St Pancras International railway station, London, for the latest round of the negotiations on a free trade deal between the EU and the UK PA UK news in pictures 8 September 2020 Dawn over Coquet Island, a small island off Amble on the Northumberland coast PA UK news in pictures 7 September 2020 A hovercraft arrives to Southsea, Hampshire from the Isle of Wight PA UK news in pictures 6 September 2020 Forensics officers near the scene of multiple reported stabbings in Birmingham Reuters UK news in pictures 5 September 2020 Anti-migrant protesters demonstrate in Dover against immigration and the journeys made by refugees crossing the Channel to Kent PA UK news in pictures 4 September 2020 Activists take part in a demonstration against the HS2 hi-speed rail line outside the Department of Transport AFP via Getty UK news in pictures 3 September 2020 Peter Baker, who plays Trigger in the musical version of Only Fools and Horses, sweeps the stage of the Theatre Royal Haymarket in London, after observing a 15 minute silence to show solidarity with those in the theatre industry that have lost their jobs due to the coronavirus pandemic PA UK news in pictures 2 September 2020 Kadie Lane, right, 11, and Brooke Howourth, 11, hug on their walk to Marden Bridge Middle School in Whitley Bay, Tyne and Wear, for their first day of term, as schools in England reopen to pupils following the coronavirus lockdown PA UK news in pictures 1 September 2020 Extinction Rebellion protesters sitting outside The Houses of Parliament in Westminster, London PA UK news in pictures 31 August Surfers at Long Sands Beach, Tynemouth PA UK news in pictures 30 August Black Lives Matter protesters march through Notting Hill in London in the first Million People March EPA UK news in pictures 29 August A protester reacts as she demonstrates against the lockdown and use of face masks, amid the coronavirus disease outbreak, outside Downing Street in London Reuters UK news in pictures 28 August Caribbean soca dancers display their costumes as they promote the first ever digital Notting Hill Carnival, following the cancellation of the normal Carnival festivities due to the continued spread of the coronavirus disease, in London Reuters UK news in pictures 27 August Father and son team Chris and Sam Milford from historic building conservation specialists WallWalkers begin restoration work on the spire of Norwich Cathedral, which stands at over 312ft high. The first known spire was completed in 1297 PA UK news in pictures 26 August Giant waves at Seaham in County Durham, as the bad weather continues PA UK news in pictures 25 August An assistant at the Wallace Monument cleans the case which houses the William Wallace sword in the Hall of Arms room at the monument near Stirling as they prepare to re-open PA UK news in pictures 24 August Restored World War Two landing craft LCT 7074 is transported from from the Naval Base in Portsmouth to its final resting place at the D-Day Story at Southsea PA UK news in pictures 23 August Jenny Nguyen and Tony Cao, from Vietnam, pose for wedding photos on Tower Bridge in London, as it remains closed to vehicles after it was stuck open on Saturday due to a "mechanical fault". The landmark's Twitter account confirmed only pedestrians and cyclists could use it on Sunday morning PA UK news in pictures 22 August England's Zak Crawley hit 267, joining the exclusive Double Hundred club, on day two of the Third Test match against Pakistan at the Ageas Bowl, Southampton PA UK news in pictures 21 August Harri Teale gathers lavender during the annual harvest on the Wolds Way Lavender farm near Malton in North Yorkshire PA UK news in pictures 20 August Parents and a student react after checking GCSE results at Ark Academy in London Reuters UK news in pictures 19 August Tate Modern workers hold a strike outside the gallery in London, to protest the institution's announcement that it would cut more than 300 jobs from its commercial arm, Tate Enterprises PA UK news in pictures 18 August Two rescued brown bear cubs, Mish (left) and Lucy, cool off in a pool after arriving at their new home with the wildlife conservation charity Wildwood Trust in Herne Bay, Kent. The orphaned pair, who have been living in a temporary home in Belgium since they were found abandoned and alone in a snowdrift in the Albanian mountains, will be acclimatised to their new life in the country before moving to a permanent home PA UK news in pictures 17 August A level students celebrate outside the Department for Education in London after it was confirmed that candidates in England will be given grades estimated by their teachers, rather than by an algorithm. The government U-turn comes just days after Education Secretary Gavin Williamson vowed there would be "no U-turn, no change. PA UK news in pictures 16 August Wasp players take a knee as Northampton Saints stand prior to kick-off in their Premiership match at Franklin's Gardens PA UK news in pictures 15 August Piper Colour Sergeant Lil Bahadur Gurung attends the VJ Day National Remembrance event, held at the National Memorial Arboretum in Staffordshire, Britain Reuters UK news in pictures 14 August People including students hold placards on Whitehall outside Downing Street as they protest against the downgrading of A-level results. The government faced criticism after education officials downgraded more than a third of pupils' final grades in a system devised after the coronavirus pandemic led to cancelled exams yes AFP via Getty UK news in pictures 13 August Benita Stipp (centre) and Mimi Ferguson (left) react as students at Norwich School receive their A-Level results PA UK news in pictures 12 August 2020 A train derailment near Stonehaven has left three people dead. Driver Brett McCullough, conductor Donald Dinnie, and a passenger were killed when the 6.38am Aberdeen to Glasgow Queen Street service crashed amid heavy rain and flooding BBC UK news in pictures 11 August 2020 A woman hydrates in the sun after open water swimming at the West Reservoir Centre in north London Tolga Akmen/AFP via Getty UK news in pictures 10 August 2020 Prime Minister Boris Johnson takes part in an archery session as he visits Premier Education Summer Camp at Sacred Heart of Mary Girls' in Upminster Reuters UK news in pictures 9 August 2020 People cycle through Cambridge as the heatwave continues in Britain EPA UK news in pictures 8 August 2020 Healthcare workers take part in a protest in London over pay conditions in the NHS Getty UK news in pictures 7 August 2020 Emergency services make their way along the seafront on Bournemouth beach in Dorset on one of the hottest days of the year PA UK news in pictures 6 August 2020 Alison Murphy poses for a picture by husband Peter as she walks through a field of sunflowers in Altrincham, Cheshire PA UK news in pictures 5 August 2020 Pakistan's Abid Ali being bowled by England's Jofra Archer during day one of the First Test match at the Emirates Old Trafford, Manchester PA UK news in pictures 4 August 2020 The 'Timbuktu tumblers' from Kenya perform their balancing act on the Southsea waterfront as Zippos Circus reopens in Portsmouth Rex UK news in pictures 3 August 2020 Pelicans interact with a visitor in St James's Park in London PA UK news in pictures 2 August 2020 Lewis Hamilton drives with a puncture towards the finish line to win the Formula One British Grand Prix at Silverstone POOL/AFP via Getty UK news in pictures 1 August 2020 Arsenal's Pierre-Emerick Aubameyang celebrates with the trophy and teammates after winning the FA Cup, as play resumes behind closed doors following the outbreak of the coronavirus disease Pool via Reuters UK news in pictures 31 July 2020 People enjoy the sunny weather at a Bournemouth Beach Reuters

M Trump “said it to us, he said it in public: ‘I’m going to consider you guys, the union, the subject-matter experts on how we secure the border’,” said Mr Harris, the former agent and Border Patrol union official from Southern California who retired last year. “We had never heard that from anyone before.”

The private Facebook group, which was created in 2016 and had more than 9,000 members, became a forum for agents to vent about the increasingly thankless nature of their jobs and the failure of successive administrations to fully secure the border.

In some ways, though, the posts reflected a culture that was long apparent in parts of the agency. For years, the Border Patrol has quietly tolerated racist terminology. Some agents refer to migrants as “wets”, a shortened version of “wetbacks.” Others call them “toncs”.

“Tonc” may have originated from an acronym referring to unknown nationality, but that is not how it is widely understood these days.

Jenn Budd, a former agent of six years who is now an outspoken critic, said a supervisor at her Border Patrol station in California had explained the term to her: “He said: ‘It’s the sound a flashlight makes when you hit a migrant in the head with it’.”

All the agents interviewed by The Times concurred.

Fox radio host Todd Starnes compares 'invasion' of undocumented immigrants to Nazis

Josh Childress, a former agent in Arizona who quit in 2018 because the job had begun to wear him down, said the Facebook posts hinted at a deeper, darker problem in the agency’s culture.

“The jokes are not the problem,” he said. “Treating people as if they aren’t people is the problem.”

Calexico, California, 120 miles east of San Diego in Southern California’s agrarian Imperial Valley, offers a glimpse of the relationship between a border community and the agents.

Hemmed in by rugged mountains, desolate desert and the Colorado River, the valley has an economy that revolves around seasonal farm jobs and government work. Temperatures top 110 degrees during the parched summer months.

About 800 Border Patrol agents work in the vast El Centro Sector, which runs about 70 miles across the Valley. They patrol on bikes and in their white vehicles in Calexico, whose downtown sits up against the rust-coloured bollards that separate the United States and Mexico.

When Mr Trump visited the city in April to tout 2.3 miles of a new border barrier – a row of 30-foot-tall, slender steel slats with pointed edges – Angel Esparza organised a binational unity march that drew 200 people. But he said the march was to protest the US president, not the Border Patrol.

Mr Esparza has featured Border Patrol agents on the covers of two issues of Mi Calexico, a magazine that he produces and distributes sporadically in this town of 40,000.

“The Border Patrol agents are part of the community,” he said.

Support free-thinking journalism and attend Independent events

Operating in communities that are often heavily Hispanic and quietly hostile to Mr Trump’s immigration agenda, the Border Patrol has become more openly political than at any time in its history.

Agents have nurtured a strong loyalty to the president, whom many of them see as the first chief executive who is serious about border security.

The union endorsed Mr Trump in 2016, a move that gave the Border Patrol a line of communication to the White House but has also created friction in Democrat-dominated border communities.

Democratic lawmakers flocked to the Texas border throughout the spring, many holding news conferences to criticise the filthy, crowded conditions in which migrants, including children, were being held – some with unchanged diapers, little access to showers and little or no hot food.

Agents said they had done the best they could – some bought toys for the children in their care – but were simply overwhelmed by the number of new arrivals.