Donald Trump's surprise visit south of the border Wednesday — apparently to mend fences after a campaign laced with anti-Mexican rhetoric — surprised many observers in both countries.
But a closer look at the state electoral vote map helps explain the Republican presidential nominee's sudden interest in Mexico. The states he needs to win rely heavily on Mexico as a customer for exported goods. And they have large blocs of Hispanic voters.
Until recently, Trump has made his anti-immigration stance one of the cornerstones of his campaign. He has blamed Mexico for the loss of American jobs, and promised to renegotiate or scrap the 1994 North American Free Trade Agreement trade deal between the United States, Mexico and Canada.
In a brief joint news conference after meeting with Mexican President Enrique Pena Nieto, Trump repeated his objections to the trade deal.
"I shared my strong view that NAFTA has been far better for Mexico than the U.S.," he said. "It must be improved upon so workers in both countries benefit from fair and reciprocal trade."
With just 10 weeks to go until the election, Trump trails Democratic rival Hillary Clinton in most opinion polls nationally.
Now, Trump seems to have had a change of heart about America's second-biggest trading partner. Intentionally or not, his trip Wednesday highlights the importance of the Mexican economy to the U.S. and of Hispanic voters in key states he needs to win.
Overall, Mexico is the second-largest customer for American exports of goods — everything from cars and trucks to computers and machinery.
But Mexico is a much more important customer for some U.S. states than others.