MEXICO CITY — For years, the United States outfitted its armed forces and hospitals with products made partially in Mexican factories, trusting that the world's busiest cross-border supply chain could withstand any crisis.

Then came the novel coronavirus, and a new question: Would Mexico keep its workers on the line to continue producing goods considered “essential” to the United States?

Within weeks of the World Health Organization’s declaration of a pandemic, major U.S. manufacturers were complaining that their Mexican factories were being shuttered without notice.

Mexico’s federal government said it would leave open “businesses necessary to confront the emergency,” but left the implementation to individual state governors, whose approaches have been mixed. In many cases, companies deemed essential in the United States have had their operations shuttered in Mexico. Mexican state officials have broadcast unannounced visits to factories live on social media, ordering them closed as workers looked on.

After decades of increasing economic interdependence, the pandemic is challenging the premise of globalization, leaving countries more clearly prioritizing their own interests. Governments around the world are reopening their economies on different timelines and under disparate policies, threatening longtime trade relationships.

The supply chains linking the United States, Mexico and Canada have grown so robust and sophisticated in the decades since the North American Free Trade Agreement was signed that they have come to feel almost borderless. The interiors of many Boeing airplanes are now made in Tijuana, the city where Lockheed Martin does some of its electrical work. Both military and civilian aircraft are constructed using components sourced across North America.

But as the first coronavirus cases hit Mexico, workers here began raising concerns that they were risking their lives to provide for the U.S. defense and health-care industries, along with other sectors north of the Rio Grande. Demonstrators fanned out to factories across Mexico’s industrial corridor.

As the United States seeks to reopen its economy, U.S. companies want their Mexican factories to come back to life — but Mexico’s coronavirus outbreak continues to worsen. The country has reported more than 17,799 cases and 1,732 deaths, but officials say that’s probably a significant undercount. The trade relationship between the United States and Mexico faces one of its most uncertain moments in years. 

In April, the Pentagon said Mexico’s supply chain was “somewhat problematic for us.” On Thursday, Ellen Lord, the Defense Department’s undersecretary for acquisition and sustainment, told reporters there had been some improvement. Mexico, she said, “has taken great strides to evaluate firms and their contribution to U.S. national security requirements.” She declined to provide details.

In a statement to The Washington Post, the Mexican government said it was aiming “to strike a balance between the measures necessary to mitigate the health crisis and seek to maintain essential economic activities in operation.”

“The three countries are jointly planning the gradual reopening of the economies of North America, always in the safest and most efficient way possible,” the ministries of health and foreign affairs said in the joint statement.

U.S. health-care companies have already been affected. In mid-April, the governor of Baja California closed a factory belonging to Smiths Medical Inc., where ventilator components were produced, because the Minneapolis-based company said its products were made for export.

Smiths did not respond to a request for comment.

A company that produces air conditioning units for U.S. hospitals was also shuttered, as was a firm that makes water heaters for hospitals. In some cases, the production of medical devices was permitted, but the production of the cardboard boxes in which those devices were transported was halted.

“These companies don’t support or contribute to the state,” Baja California governor Jaime Bonilla Valdez said. During “the health emergency, they are considered [to be performing] nonessential activities.” 

The closures have shaken major U.S. government contractors, whose work is deemed essential north of the border, but not south of it. Mexican President Andrés Manuel López Obrador has not clarified whether U.S. defense or health-care manufacturers should remain open.

“Companies are left scratching their heads when they learn that their partners in Mexico don’t see what they do as an essential service, even as they’re called to do pandemic response,” said Dak Hardwick, the assistant vice president for international affairs at the Aerospace Industries Association.

The National Association of Manufacturers wrote to López Obrador that his government’s lack of clarity “has resulted in the shuttering of essential manufacturing facilities across Mexico, including those that serve as the backbone to critical infrastructure across our continent, potentially weakening our response to the COVID-19 pandemic.”

Few events have raised such pressing questions about the mechanics of the international supply chain. In the 26 years since NAFTA was signed, the trends for manufacturing here were mostly positive: hundreds of thousands of new jobs created in Mexico; inexpensive, efficient production for the United States.

Even after both countries elected populist presidents wary of a frictionless North American supply chain, the concept of a continental free-trade zone endured: The U.S.-Mexico-Canada Agreement, the successor to NAFTA signed by the three countries last year, is due to take effect July 1. Before the coronavirus, that felt like a codification of the region’s commercial ties.

The NAFTA bylaws allow its members to act in their own interests “in times of war or other emergency in international relations.” But until now, that contingency has rarely been tested. 

Luis de la Calle, who helped craft NAFTA as Mexico’s undersecretary for international trade negotiations in the 1990s, said the countries did not coordinate ahead of the pandemic “in a joint fashion.”

“They should have agreed that if one country deems a sector to be essential, the two other countries should deem suppliers essential,” de la Calle said. “But that’s not what happened here.”

In Ciudad Juárez, where Lear Corp. produces car seat covers, workers began falling ill in March. By April, as many as 13 had died of the coronavirus, according to employees. Lear declined to confirm numbers.

“Due to COVID-19, we have seen a tragic situation of fatalities in the city of Juarez including our Rio Bravo facility, which we closed on March 27, prior to government orders,” Lear said in a statement. “These deaths have occurred despite the early implementation at Rio Bravo of COVID-19 protocols, the same protocols that have been successful in limiting the impact of the virus within our facilities globally, including those in China, Italy, Spain and U.S.” 

Protesters began arriving at Lear’s factory and others where workers were said to have become sick. They held signs and chanted through megaphones.

“These companies are worried about their supply chains, but it’s the workers who are dying,” said Susana Prieto Terrazas, a labor activist in Ciudad Juárez. “And if all they do is export, how is that essential to Mexico?” 

Workers in a Tijuana factory that produces diapers for export told The Washington Post that social distancing was impossible. They said employees have been told to stand in their usual positions along a conveyor belt, a foot from each other. 

“We handle the diapers without gloves, and we touch our faces. They did not give us masks, so those diapers can be contaminated and go to the United States,” said Maria, 28, who declined to give her last name because she worried she would be fired.

She said she became sick last week with several coronavirus symptoms. She went to a doctor, she said, but was not tested for covid-19. She’s now recovering at home. 

U.S. and Mexican industry groups say they believe most production can continue safely with more shifts and fewer workers per shift, and additional health measures. 

“The work conditions of these factories are safer than the conditions outside for many workers,” said Carlos Higuera, president of Tijuana’s economic development corporation. “When they are outside, many of them are congregating in markets; they are in small spaces with many people, where they are more likely to get sick.” 

But in the state of Baja California, where Tijuana is located, politicians have been vocal in their opposition to companies operating through the pandemic. 

“Employers do not want to stop earning money, and prefer to sacrifice their workers before their profits,” Bonilla said. 

The state labor ministry has posted photos and videos of officials forcing factories to shut down. In one series of images, officials visit Sensata, a U.S. company that produces sensors used by the automobile, aerospace and health-care industries. Its Tijuana factory produces material for ventilators used in U.S. hospitals.

The state officials said they were responding to workers’ complaints about a lack of social distancing and other health and safety concerns. They asked Sensata executives to “fulfill the mandate of closing nonessential activities,” the labor secretary posted on Facebook.

“We respectfully disagree with the implication that the working conditions in the Tijuana facility are unsafe,” said Alexia Taxiarchos, a company spokeswoman. “We have taken all necessary measures to keep our people safe. We have 22,000 employees globally and fewer than five confirmed cases currently, which is a testament to how seriously we are taking this.”

The company wrote to the government explaining why its work should be deemed essential, and officials allowed it to reopen.

Across the manufacturing industry, the closures have left U.S. suppliers deeply worried. 

“We get reports of more shutdowns and reopenings every day,” said Hardwick, of the aerospace industry group. “The guidelines keep changing. It feels like it depends on individual health inspectors and factories. Our companies play by the rules. It’s that the rules are inconsistent.”

Many U.S. production facilities in industries deemed essential have continued to operate during the country’s outbreak. Others closed temporarily and are now reopening. 

Mexico is several weeks or more behind the U.S. epidemiological curve. U.S. companies worry that what initially appeared to be a temporary setback could be a long-term one, threatening the future of the North American supply line. 

But if the supply problems can be solved, analysts say, there’s reason to hope for a more prosperous future.

“If North American supply chains prove to be reliable during the pandemic,” said de la Calle, “the amount of investment that would shift here from Asia would be enormous.”

Gabriela Martínez contributed to this report.