Taiwan’s economy, which began 2016 in contraction, concluded it on the strongest footing in almost two years as stronger trade activity helped offset weakness in consumption. Gross domestic product rose 2.58 percent in the fourth quarter from a year earlier, preliminary data from the statistics bureau showed Wednesday. That compared with a median estimate of 2.85 percent growth in a Bloomberg survey and followed 2.03 percent third-quarter growth. Strong growth of expenditures tied to exports was outweighed by weakening private consumption and government spending, government data showed. The island’s economy has shown signs of resilience in the past year as it recovered from three quarters of contraction that ended in March. That’s putting it in a better position to prepare for looming challenges including the protectionist stance of Donald Trump that ultimately may weigh on trade conditions across export-led Asian economies. “Taiwan’s economy rebounded strongly in the final quarter of last year, but with weak global demand set to drag on exports and limited scope for more policy support, the recovery is likely to run out of steam soon,” Gareth Leather, a senior Asia economist at Capital Economics in London, wrote in a report. “Weak growth in Taiwan’s main trading partners is likely to weigh on export demand.” Taiwan last month held its benchmark interest rate at a six-year low of 1.375 percent for a second-straight quarter as indicators signaled strength and improving growth prospects for 2017. The central bank said it will monitor global situations including Trump’s policies and anti-globalization trends. “Taiwan’s economy will definitely be very vulnerable to a potential U.S.-China trade war,” said Raymond Yeung, chief greater China economist at Australia & New Zealand Banking Group Ltd. in Hong Kong. “Global supply chains would be affected negatively and Taiwan will be in the middle of it.” Exports of goods and services climbed 8.16 percent in the fourth quarter from a year earlier, while overseas shipment of goods surged 11.73 percent, the statistics bureau said. Neither the private sector nor the government show much willingness to spend. Consumption contributed 0.51 percentage point to the quarter’s expansion, down from the 1.79 percentage point in the third quarter. Investment picked up the slack, contributing 1.7 percentage point while net exports added 0.37 percentage point. “As long as there isn’t a trade war between the U.S. and China, Taiwan’s economy will continue to rebound, ” said Rick Lo, senior economist at Fubon Financial Holding Co. in Taipei, citing recovering global demand and the upcoming iPhone expected later this year. “But if there’s a trade war, Taiwan will be a victim.”