As President Donald Trump wages a public and bellicose battle with the Mexican government, China may emerge as the victor. The world's number-two economy is closely watching as Trump threatens to renegotiate the North American Free Trade Agreement and presses Mexican President Enrique Peña Nieto to finance construction of a border wall. The Mexican economy, already facing a slowdown, could deteriorate further under both scenarios. Either way, strategists widely agree Mexico will look to reduce dependence on its largest trading partner, and Beijing is likely to emerge as a contender to replace the void left by Washington.

Chinese President Xi Jinping (right) shakes hands with Mexican President Enrique Pena Nieto at the 11th G20 Leaders Summit on September 4, 2016 in Hangzhou, China. Lintao Zhang / Getty Images

"Like other countries worried about the uncertainties of a Trump administration, Mexico will look to deepen engagement with China," said Shawlin Chaw, senior analyst at Control Risks. "The mainland is a natural choice due to its economic power and in return, Beijing will able to increase the international market for Chinese exports and diversify its sources of raw materials."

Mexico has one of the highest number of bilateral trade agreements in the world and China was its third-largest trading partner in 2015—with exports to the mainland tallying $4.9 billion, according to the World Bank. The two pledged to strengthen ties at a meeting in December, with business deals already underway. In fact, Anhui Jianghuai Automobile and Giant Motors, partially owned by Mexican billionaire Carlos Slim, announced Wednesday they would pump more than $212.46 million into SUV production in Hidalgo. From investments in Africa to South America, Bejing has been carefully extending its sphere of influence in regions well outside its backyard as it looks to cement status as a global superpower. A number of U.S. allies have expressed concern over the apparently isolation-prone Trump administration, and China is looking to exploit that dynamic. Chinese President Xi Jinping emphasized that point at the World Economic Forum in Davos last month, saying his country was ready to take on a leadership role in international trade. "China will certainly fill up the American vacuum in Mexico," said Jonathan Bogais, adjunct associate professor, at the University of Sydney. Peña Nieto's other options include the European Union and Japan, but Bejing is the most obvious choice, he added.