Donald Trump Donald John TrumpBubba Wallace to be driver of Michael Jordan, Denny Hamlin NASCAR team Graham: GOP will confirm Trump's Supreme Court nominee before the election Southwest Airlines, unions call for six-month extension of government aid MORE took a surprise trip to Mexico City on Wednesday to share the stage with a man he’d previously treated with distrust — Mexican President Enrique Peña Nieto.

Trump's trip came as a complete shock to even die-hard political observers, and it showed that the businessman is ready to gamble as he seeks to close the gap with his Democratic rival, Hillary Clinton Hillary Diane Rodham ClintonJoe Biden looks to expand election battleground into Trump country Biden leads Trump by 12 points among Catholic voters: poll The Hill's Campaign Report: Biden goes on offense MORE.

Here are five takeaways from Trump's joint press conference with Mexico's president.

ADVERTISEMENT

1. Trump is willing to take risks to win

Mexico was a risky choice for Trump’s first foreign visit as the Republican presidential nominee.

He has spent his entire campaign bashing Mexico as stealing American jobs and accused the country's government of actively sending rapists and drug dealers across the border.

By traveling to Mexico, and by softening his tone as he stood next to the Mexican leader, Trump risked alienating his most hard-core supporters.

The fact that he did it anyway shows that Trump understands the position he's in.

And given that he delivered a sure-footed performance in Mexico City, perhaps Trump will take more risks in the final sprint to Election Day.

ADVERTISEMENT

2. Trump wants to show he can be a world leader

The stagecraft Wednesday said almost as much as the words that came out of Trump's mouth. The joint press conference with Peña Nieto was set up like a meeting between world leaders, with podiums and questions from the press.

Trump's team clearly wanted the audience of Americans watching at home to visualize the businessman as their president.

The GOP nominee seemed to embrace that role. He hardly cracked a smile, and looked somber, nodding respectfully as the Mexican president spoke and as a woman translated for him.

When it came time for Trump to speak, he read from notes from start to finish and resisted the urge to improvise the way he usually does when he's reading from a teleprompter and senses boredom in a crowd.

3. Trump is taking on Clinton's criticism that he's unfit for office

By focusing largely on areas of agreement with Mexico's president and refusing to inflame the biggest area of controversy — the question of whether Mexico is going to pay for a border wall — Trump tried to show that he's a leader capable of modulating his behavior when the situation requires it.

The most telling moment came in the question-and-answer section after Trump's statement, when ABC News reporter Jon Karl asked whether Trump and Peña Nieto settled the question of who would pay for the wall.

Trump said he discussed the wall with Peña Nieto but not who would pay for it.

4. Trump is softening his message for a general election audience

The Trump that showed up in Mexico City was a far cry from the bombastic billionaire who began his primary campaign by declaring that people crossing the border illegally were rapists and that "Mexico is not our friend."

He concluded his Wednesday remarks by saying to Peña Nieto, "I call you a friend."

While he still said Mexico was getting the better deal when it comes to trade, Trump changed his wording in an important way. Instead of his usual refrain that jobs needed to be kept in America, Trump repeatedly said that wealth needed to be kept "in our hemisphere" for the benefit of both the Mexican and American people.

Trump also lavished praise on the Mexican people repeatedly.

He talked about the numerous Mexican-Americans he counted as friends and the thousands he employed. They are "spectacular" and "hard-working" people, he said, and he has "such respect for them."

5. But Trump isn't shifting on his core ideas

Trump is set to elaborate on his immigration plans when he gives a speech in Phoenix on Wednesday night, but from what was said in Mexico City, he is staying close to his core ideas.

While standing next to Peña Nieto, Trump repeated his position that the North American Free Trade Agreement (NAFTA) has been more beneficial for Mexico than the United States.

Trump also insisted that his border wall would be built and declared, as his No. 1 shared goal with Mexico, that under his presidency he would end illegal immigration.

And although he politely avoided restating that Mexico would pay for the wall, there was nothing in what Trump said that suggested he had backed away from that promise.