Republican nominee Donald Trump will make a hastily scheduled trip to Mexico Wednesday to meet with President Enrique Peña Nieto just hours before he is scheduled to attempt to clarify his controversial, and sometimes conflicting, positions on immigration.

The trip is a high-stakes gamble by the bombastic billionaire reality television star, who is trailing in swing state and national polls, in meeting one of his most vocal critics on his home soil. While it offers Trump an opportunity to project his presidential side to American voters, the visit is also fraught with peril for a candidate who is a novice on the geopolitical stage and who is widely reviled in Mexico. Trump aides did not immediately detail the candidate’s goals for the meeting with Peña Nieto, who faces deep disapproval himself.

Trump, who has called for a concrete border wall along the U.S.-Mexico border—and claimed that Mexico would pay for it— has been a frequent critic of Mexico and its leaders on the campaign trail. He has called for a renegotiation of NAFTA to prevent U.S. manufacturing from moving to Mexico, suggesting he would impose tariffs on Mexican imports or limit remittances. At his campaign announcement last June, Trump suggested that many Mexican immigrants to the U.S. are rapists. Earlier this year, he objected to an Indiana-born federal judge presiding over a case involving his defunct Trump University over his “Mexican heritage.”

The trip comes as his campaign has been bedeviled over his comments last week that he was “softening” his position on forcibly deporting the 11 million people in the U.S. illegally—about half of whom hail from Mexico. Since then, Trump has characterized his position as a “hardening,” while aides have maintained that he has been entirely consistent over the course of his campaign. On Tuesday, Trump campaign manager Kellyanne Conway said categorically that Trump opposes any path to legal status for the 11 million people in the U.S. illegally—and would instead empower law enforcement to ramp up deportations. Trump’s allies have backed away from the candidate’s promise to create a separate “deportation force,” but aides have said he intends to strengthen federal agencies to carry out more removals.

Trumps’s message to Peña Nieto in private, and in public later Wednesday, when he is set to discuss his immigration plan in Phoenix, are set to be among the most scrutinized moments of the general election so far. Trump’s campaign has seen political advantage in maintaining ambiguity in what he would actually do as president, but the uncertainty has caught up with him in recent days. As he tried to broaden his appeal to voters skeptical of his hardline stance, the policy confusion left even Trump’s most stalwart supporters puzzled, as he seemed to backtrack on one of the signature issues that helped him win the GOP nomination.

Confirmed in a tweet by the candidate late Tuesday, the trip was organized in the last several days, with aides to the candidate and the Mexican leader working until the final minutes before the announcement to iron out the details for a visit that would normally require weeks of protocol and security planning. Peña Nieto’s office said in a subsequent tweet that the meeting would be private.

Peña Nieto has been a frequent critic of Trump’s policies and tone, rejecting the notion that Mexico would pay for a border wall. In March, he likened Trump’s nationalistic tone to that of Adolf Hitler and Benito Mussolini, and warned that his rhetoric was damaging U.S.-Mexico relations.

The trip is Trump’s second trip abroad since declaring his campaign, the first being a June visit to the United Kingdom to mark the opening of one of his golf courses just days after the UK voted to leave the European Union. Trump will fly to Mexico after first holding fundraising events in California Wednesday morning.

Peña Nieto has invited both Trump and Democratic nominee Hillary Clinton to visit to discuss bilateral relations between the two countries, according to his office.

The Clinton campaign confirmed it received a similar invitation, saying senior aides are in “regular” contact with the Mexican government and that she looks forward to speaking with Peña Nieto again “at the appropriate time.” “What ultimately matters is what Donald Trump says to voters in Arizona, not Mexico, and whether he remains committed to the splitting up of families and deportation of millions,” Clinton communications director Jennifer Palmieri said in a statement.

The Washington Post first reported Tuesday evening that the campaign was considering the visit.

Get our Politics Newsletter. The headlines out of Washington never seem to slow. Subscribe to The D.C. Brief to make sense of what matters most. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Contact us at letters@time.com.