While lawmakers this week argued over the merits of President Trump's $18 billion border wall and a potential government shutdown, the federal officers tasked with stopping drugs and terrorists from entering the country faced a different threat: exhaustion.

An acute staffing shortage of customs officers at the border has gotten so dire that the government this month began pulling screeners from U.S. airports and reassigning them to southern Arizona on an emergency basis.

U.S. Customs and Border Protection has deployed 175 officers to the agency's Tucson sector through at least March, according to union officials who say CBP officers are being routinely asked to work back-to-back eight-hour shifts to make up for the staffing shortfalls.

"They are supposed to do their job with the same mental clarity and acuity," said Anthony Reardon, president of the National Treasury Employees Union, which represents 25,000 CBP employees, "but when you work 16-hour days, days on end, it's a pretty difficult thing to do."

CBP has a nationwide deficit of 3,700 officers, said Reardon, calling it the worst shortage he has seen at the agency. The gap includes 1,200 unfilled vacancies and an additional 2,500 officers that CBP said it needs to meet staffing goals.

The shortfall points to an aspect of U.S. border security that has received little attention in the debate over Trump's immigration agenda.

Trump has called for 5,000 additional Border Patrol agents, even as the number of people arrested for illegally crossing the border has fallen to a 46-year low. Border Patrol agents now make fewer than two arrests per month on average.

Meanwhile, the workload has grown larger for the blue-uniformed CBP officers who are deployed to 328 ports of entry nationwide, including international airports and border crossings.

Bilateral commerce with Mexico, the second-largest market for U.S. exports, exceeds $1.5 billion a day, according to the latest trade figures, amounting to a nearly endless caravan of cars, trucks and trains that CBP officers must search for weapons, drugs and potential terrorist threats. The agency screens 1 million visitors and 67,000 cargo containers each day, according to its website.

Congress authorized CBP in 2014 to add 2,000 officers, but the agency has fallen far short of that target. The agency also has a deficit of 731 agriculture specialists who screen for animal and plant pests as well as loads of narcotics often smuggled in shipments of fruit and vegetables, according to its hiring plans.

The shortages are most critical at the busy border crossings around San Diego and in southern Arizona, where officers normally assigned to checking passports at U.S. airports are being sent to search cars and trucks for heroin and other contraband.

In response to questions about the need for the short-term deployments, CBP provided a statement characterizing them in favorable terms. "Temporary duty assignments are not uncommon and could be for a variety of reasons, to include development opportunities, training needs, or seasonal fluctuations," the statement read. "These assignments are beneficial to both the temporary duty location and the permanent duty location as personnel return to their home ports with experience in a wider diversity of CBP operations and enhanced decision making skills."

A group of Florida lawmakers sent a letter last week to Homeland Security Secretary Kirstjen Nielsen, protesting the emergency deployment of 10 CBP officers from the Orlando International Airport to the Mexican border.

"Temporarily removing CBP officers from OIA places greater strain on the remaining CBP officers and will mean longer lines for travelers," Rep. Val Demings (D-Fla.) said in a news release.

According to Demings, the number of CBP officers assigned to the airport has remained flat, even as international arrivals have increased 89 percent since 2009.

"Even with maximum number of personnel in the facilities, the arrivals hall quickly overflows during peak times, forcing passengers to remain on aircrafts until previous arrivals have cleared Customs and Immigration," the lawmakers said in the letter to Nielsen.

According to Reardon, the agency signed a $297 million agreement in November with Accenture, a federal contractor, to help with hiring.

Reardon told a House subcommittee this month that the contract will pay Accenture $39,600 for every new hire, an amount nearly equal to a starting officer's annual salary.

While CBP has struggled to retain officers frustrated by the long hours and separation from family, its potential recruits face a hiring process that can take as long as 18 months, Reardon said.

"CBP is the only federal agency with a congressional mandate that all front-line officer applicants receive a polygraph test," he testified to lawmakers. Two out of three applicants fail its polygraph, according to Reardon, more than double the average failure rate for other federal law enforcement agencies.

Many would-be hires are disqualified for lying about past recreational drug use or other behavior that would not necessarily render them ineligible, and CBP is reviewing the way it administers the test.

A Senate bill introduced this week by Sen. Claire McCaskill (D-Mo.) would require CBP to hire no fewer than 500 officers per year until the staffing gap is filled, calling the agency's officers "our first line of defense against opioids or other illegal drugs entering the country."

Trump has described his border wall proposal as a solution to stopping the flow of narcotics into the United States, but CBP statistics show most hard drugs are seized at ports of entry — not in the open desert where a wall might go.

While bulky loads of marijuana are typically carried by smugglers hiking through the desert with backpacks, more-compact and valuable substances such as cocaine, heroin and the deadly synthetic opioid fentanyl enter the country behind concealed in vehicle panels or hidden in commercial cargo.

Stopping those shipments is the responsibility of CBP officers, and Reardon said many are buckling from the strain of double shifts and emergency deployments. The result is that fewer officers are available for the more thorough "secondary" inspection procedures. "In the past, there were three inspectors in secondary processing for every one inspector in primary processing," he told the House subcommittee on border and maritime security. "Now there is a 1-to-1 ratio."

"Morale is extraordinarily low," said Reardon. "And that doesn't help our recruitment efforts."