MEXICO CITY — As demand soars for medical devices and personal protective equipment in the fight against the coronavirus, the United States has turned to the phalanx of factories south of the border that are now the outfitters of many U.S. hospitals.

Less than a year after President Trump threatened to impose tariffs here, Mexico’s $17 billion medical device industry is ramping up production of everything from ventilator components to thermometers and hospital beds — and scouring the country for workers willing to work through the pandemic.

The products, manufactured largely in factories run by U.S. corporations, will land in almost every hospital in the United States. Very few will remain in Mexico. It’s a byproduct of globalization distilled clearly during a pandemic: A nation that produces lifesaving medical equipment isn’t necessarily the one that gets to keep it.

“There’s this incredible irony that many of the medical devices that will save lives in the United States were made in Mexico, but most Mexicans won’t have access to them,” said Andrew Selee, president of the Migration Policy Institute, a Washington think tank.

On Thursday, the mayor of Tijuana implored the city’s medical device manufacturers to “increase the portion of your production for local consumption.”

“We recognize the importance of your work for the economic development of the country,” Mayor Arturo González Cruz wrote. “But the health and well-being of Mexicans is even more important.”

Tijuana, once considered a seedy border town, has emerged in the last two decades as one of the world’s most important hubs for the production of medical equipment. Its growth in advanced manufacturing has helped make Mexico the biggest exporter of medical devices to the United States.

The city’s manufacturers said it would be difficult to heed Gon­zález Cruz’s call.

“The great majority of what we produce is made for export,” said Carlos Higuera, the president of Tijuana’s economic development corporation. “With federal government regulation in Mexico, and the way these companies are structured, it’s not easy to turn around and start producing for local consumption.” 

As U.S. demand for face masks, ventilators and other materials increased over the last month, recruiters in northwestern Mexico began holding job fairs in small towns. But police considered those fairs a public health risk and shut them down. 

The balance between meeting U.S. need and protecting employees has been a challenge in some parts of the country, where unions and local politicians have protested the call for factory work in the midst of the outbreak. “If we want to avoid a massive spread of coronavirus, it is necessary that the worker stay at home with his family,” said the mayor of Matamoros, Mario López Hernández.

But the calls keep coming. Haemotronic, an Italian company with a factory in Reynosa, Mexico, received a request this week for 1.5 million IV tubing extensions specifically crafted for the treatment of the coronavirus, allowing nurses to keep more distance from infectious patients.

The company says it has implemented measures, including providing private transportation, to protect its workers. “I don’t think finding people will be a problem unless the virus surges in Mexico,” said Ettore Ravizza, manager of the Reynosa plant. “The covid situation just highlighted how strategic or essential we are for the well-being of our fellow humans.”

Mexico has reported 1,510 cases of the virus. Officials acknowledge that actual case numbers are almost certainly higher because testing is limited.

As the world races to increase production of ventilators, many parts of those, too, will come from Mexico. Supply chains for ventilators straddle the border, with ­components pieced together in both countries.

Integer of Plano, Tex., operates factories in Tijuana and Ciudad Juárez, where it produces batteries for ventilators that are completed in the United States. Hillrom, based in Batesville, Ind., makes some ventilator components in its Tijuana factory and plans to begin producing the Life2000 noninvasive ventilator there in the coming months.

Hillrom has seen U.S. demand surge for its other products. It’s making 500 million probe covers, used to protect thermometers, every three months. Demand for stretchers has doubled. 

“It’s very likely the first things that a patient needs or comes into contact with, will have been produced in Mexico,” said Howard Karesh, a Hillrom spokesperson.

Among the company’s 1,300 employees in the country, Karesh said, coronavirus cases were “extremely limited.”

Becton Dickinson, based in Franklin Lakes, N.J., employs 15,000 people in Mexico who produce “multiple billions of products and components” every year, company spokesman Troy Kirkpatrick said. They include catheters and IV sets now being used to treat coronavirus patients in the United States.

“We have been in contact with the governor’s offices in the states in which we have operations to explain the critical nature of our manufacturing to maintain a functioning global health-care system and the precautions we are taking to maximize employee safety,” Kirkpatrick said.

Mexico has struggled to acquire face masks, ventilators and hospital beds. President Andrés Manuel López Obrador acknowledged last week that there were only 5,000 ventilators in the country. He ordered the purchase of 5,000 more from China. 

Trump threatened last June to impose tariffs on goods, including medical supplies imported from Mexico, to pressure López Obrador to crack down on Central American migrants crossing the country to reach the U.S. border.

Administration officials downplayed the economic impact of those tariffs on U.S. consumers, but the medical device industry was vocal in its opposition.

“We strongly believe that medical products that save and extend lives should be exempted from this action,” Scott Whitaker, the president of the Advanced Medical Technology Association wrote to U.S. Trade Representative Robert E. Lighthizer on June 7.

López Obrador agreed to step up immigration enforcement, and the tariffs were not implemented. But Trump suggested the tariffs would be a useful tool if he was not satisfied with the Mexican government’s actions.

“We can always go back to our previous, very profitable position on tariffs,” he tweeted.

Gabriela Martínez contributed to this report.