TIJUANA, Mexico — The North American Free Trade Agreement has transformed this sprawling and gumptious border town from a gritty party spot to something entirely different: a world capital of medical devices.

Trucks choke boulevards lined with factories, many bearing the names of American-born companies: Medtronic, Hill-Rom, DJO Global and Greatbatch Medical. Inside, Mexican workers churn out millions of medical devices each day, from intravenous bags to artificial respirators, for the global market.

Nearly all Americans with pacemakers — and people worldwide — walk around with parts from here.

When President Donald Trump threatens to redo trade deals and slap steep taxes on imports, he focuses largely on car companies and makers of air conditioners. But the medical devices business makes a particularly revelatory case study of the difficulties of untangling global trade.

America imports about 30 percent of its medical devices and supplies. The trouble is, there are barriers to importing the jobs tied to making them. To ensure the safety of products that often end up inside the human body, medical devices are strictly regulated and require lengthy approvals from the Food and Drug Administration and other inspectors.

As a result, any tariff tinkering by the Trump administration could jolt not only the devices industry in coming years but health care nationwide.

Here in Tijuana, the factories are bound to stay put for years, at least. During that time, health executives say, a border tax could fracture the industry’s sophisticated global supply chain and force American hospitals to pay more for vital necessities — or worse.

“The real danger is the supplies won’t be available at all,” said Dr. John Jay Shannon, chief executive of the Cook County Health and Hospitals System in Chicago.

American hospitals rely on heaps of bandages and surgical gloves from China, suturing needles and artificial joints from Ireland, and defibrillators and catheters from Mexico. In all, the annual imports of medical devices more than tripled from 2001 to 2016, reaching $43.9 billion, according to BMI Research, a unit of the Fitch Group.

Mexico is the leading supplier, ahead of Ireland, Germany and China. And few places illustrate this changing landscape, or help explain the complexity of the industry, as well as Tijuana, 20 miles south of San Diego.

The city houses the highest concentration of Mexico’s medical device firms, 70 percent of which are American-owned, according to the local development group. Companies including Medtronic, CareFusion, DJO Global and Hill-Rom-Welch Allyn — some that have their headquarters just up the road in San Diego — have invested heavily in Tijuana, constructing long, low-slung factories tucked into the hilly terrain. Giant banners hanging from manufacturing plants plead for workers to join them.

The high-tech operations emerged after NAFTA helped transform Mexican border factories, known as maquiladoras, into industrial powerhouses. Now, instead of being garment sweatshops, many maquiladoras in Tijuana employ a new generation of Mexican engineers and skilled technicians to make orthopedic devices, surgical equipment and catheters.

The factories have helped remake the city’s reputation from a ribald party town to a locus of sophisticated industrial manufacturing. Roadside shanties made of corrugated metal and plastic abut new apartment complexes painted fuchsia and lime green; late-model SUVs bounce along potholed roads. Workers pass through imposing security gates to begin shifts operating advanced machinery or delicately sewing pig tissue onto stents for heart valves, and trucks zip in a steady line across the border in preclearance, fast-track lanes into California.

But the possibility of new protectionist trade policies is already looming over this buzz of activity. The question for many people here is whether it will upend the economic incentives that led American companies to invest in the city in the first place.

Trump has argued that a border tax is needed to keep well-paying jobs in the United States and dissuade companies from relying on Mexican workers who earn a small fraction of American wages. Technicians at medical device factories in Tijuana earn about $14 an hour, compared with about $25 an hour for technicians at factories in the U.S.

Critics of Mexico’s maquiladoras system contend that wages are kept unfairly low and that workers have been kept from organizing. For companies, though, the savings are clear — as much as 45 percent for labor-intensive products — and have helped fuel the wave of development here.

Now, even the city’s unflappable longtime entrepreneurs are unsettled by the shift in trade talk.

American companies draft plans to build plants — or expand existing ones — years in advance, said Miguel Felix Diaz, vice president of the Baja California Medical Device Cluster, an organization that represents 63 medical device manufacturing plants that employ 60,000 Mexican workers.

“For that reason now,” he said, “you don’t know if you start some operation tomorrow how it’s going to be affected.”

If the U.S. does approve a border tax, Felix Diaz added, “the final customer is going to pay.”

The final tally of just how much American customers — hospitals, clinics, nursing homes and doctors’ offices — would pay is unclear. Trump and Republican lawmakers have yet to release a detailed plan on trade tariffs or corporate tax reform.

In addition, the final price on many medical devices is negotiated by group purchasing organizations, which harness the purchasing power of hospitals and others and would try to mitigate any price increases.

Mike Alkire, chief operating officer at Premier, which negotiates for some 3,750 American hospitals, said that while prices would initially spike if the Trump administration hit countries like Mexico or China with tariffs, “we’ve got enough diversity in the way we source products, we think we can manage the costs.”

“Over the long term,” Alkire added, “we do think the market will stabilize and the most efficient place to produce products will occur.”

Chief executives at some of the United States’ largest hospitals have nervously watched the gathering legislative, economic and geopolitical storm. The executives say this concern on trade is based on simple math.

In Chicago, Cook County’s public clinics and hospitals spend $62 million a year on medical supplies, including 120,432 boxes of gloves, 44,434 boxes of syringes and 403,460 bags of fluids. Safety-net hospitals that care for poor patients would be unable to pass along price increases because the programs that insure those patients, Medicaid and Medicare, pay fixed rates for care.

“It’s a bunch of dominoes,” said Doug Elwell, deputy chief executive for finance and strategy at the county hospital system. Private or for-profit hospitals, because they serve largely privately insured patients, “can pass along 10 percent in the bill,” he said. “But we can’t.”

A border tax, experts say, would ricochet back and forth across the U.S.-Mexican border — and around the world — in unintended ways.

Mexico’s medical device industry buys much of its raw materials and capital machinery from American suppliers. The American-owned Integer plant in Tijuana, for example, buys 90 percent of its raw materials, essentially duty-free, from the U.S.: stainless steel to be stamped into cups used for hip replacements and plastic to be molded into catheters. Then half of the factory’s output is shipped back to the USA and much of the rest to Puerto Rico and American-owned companies in Switzerland and Singapore.

If Mexico imposes tariffs on raw materials from American suppliers, a likely response to any border tax imposed by the U.S., production costs would spike for companies in Mexico or those companies would shift to suppliers in other countries eager to cut low-tariff deals, like China. Imports from China contain around 4 percent of content from the U.S., while imports from Mexico contain about 40 percent, and even more in products like medical devices.

“The damage wouldn’t just be to the Mexico operation, it would be to U.S. suppliers,” said Christopher Wilson, deputy director of the Mexico Institute at the Woodrow Wilson International Center for Scholars.

Companies would also face a regulatory thicket should they move or change suppliers.

The FDA inspects and certifies hundreds of medical device manufacturers in China, Europe, Mexico and elsewhere, and even minor manufacturing changes must be certified, a process that can take many months.

“Medical devices is a very stringent process,” said Jorge Hernandez, director of operations at Integer in Tijuana, an American-owned company that makes components for pacemakers and defibrillators, among other devices.

The Integer plant in Tijuana that Hernandez oversees looks like a vast scientific laboratory. Behind glass windows, in so-called clean rooms, employees in blue hair caps and bootees tend to machines that process gold and platinum into tiny components for pacemakers. In one room, workers sit shoulder to shoulder, peering into microscopes as they expertly remove tiny debris from freshly made parts. Even the smallest change in these manufacturing protocols would require a new inspection.

Integer’s legacy company, Greatbatch Medical, opened the plant in 2005. Over the years, the company consolidated some of its manufacturing from Carson City, Nev., and Columbia, Md., to Tijuana, drawn by the lower wages and the pool of skilled technicians graduating from Mexican universities.

The company, like many others here, is seamlessly integrated: Employees in Tijuana connect via videoconferences with research and development teams in the U.S. to fine-tune product designs. The border seems like a quaint historical footnote.

“People need to understand this relationship we have goes both ways,” said David Mayagoitia, president of the board of the Tijuana Economic Development Corp.

Sitting inside an office in a modern glass-and-concrete building in downtown Tijuana, Felix Diaz said Mexicans and Americans had built strong relationships.

“We are dealing daily, we are eating together, we drink a couple of tequilas,” he said. “We don’t want to start any commercial war.”