Mexico surprised economists by posting a trade surplus in November as a weaker currency spurred demand for the manufacturing exports that President-elect Donald Trump wants to impede. Latin America’s second-largest economy posted a trade surplus of $200.4 million, the nation’s statistics institute reported Friday, compared with the $900 million deficit that was the median forecast of 11 analysts surveyed by Bloomberg. None predicted a surplus, only the second of this year. Trump’s threat to tax exports from Mexican factories has undermined the peso, bolstering imports of the products he says should be produced in the U.S. Mexican manufacturing exports climbed 10 percent in November to the highest level since October 2015 as the peso tumbled to a record low, trading at more than 20 per dollar. The currency’s 17 percent drop this year ties it with the British pound for the worst performance among major currencies. “Going forward, we expect the non-oil trade balance to continue to improve, driven by a very competitive currency,” Alberto Ramos, the chief Latin America economist for Goldman Sachs Group Inc. in New York, wrote in an e-mailed research note. “This presumes no major near-term changes in the conditions for exporters to access the U.S. market.” That is a big if. Trump has promised to end or renegotiate the North American Free Trade Agreement that has been key to Mexico becoming a manufacturing powerhouse over the past two decades. Shipments to the U.S. accounted for 83 percent of Mexico’s non-oil exports in November, the statistics institute said. Vehicle exports increased 8 percent from a year earlier and sales of other products rose 9.6 percent. The peso strengthened 0.4 percent to 20.6679 per dollar in Friday morning trading.