MEXICO CITY _ It was one of the most controversial moves of his six years in office. In August 2016, Mexican President Enrique Pena Nieto invited then-candidate Donald Trump to meet with him in Mexico City.
That visit set off street protests as lawmakers expressed outrage at the presence of Trump, who had angered many here with his verbal assaults on Mexicans and his vow that Mexico would pay for a new border wall.
Now two years later, Pena Nieto has issued a public explanation for why he did it.
In a two-minute video clip released Tuesday, Pena Nieto argued that the invitation to the GOP hopeful was meant to avert dire consequences for Mexico should Trump be elected.
"It left open the door to have dialogue and familiarity with the new government of the United States," Pena Nieto said in the clip, filmed in a wood-paneled presidential office, with a Mexican flag in the background.
It was unclear why Pena Nieto decided to dredge up one of his most politically damaging moments. But it appears he is striving to create a positive legacy for what is widely viewed as a failed presidency.
He leaves office in December. The video is one of a series of formal presentations that he is recording in preparation for his final annual address to the nation.
It was released a day after the two presidents announced in a public speakerphone conversation _ with Trump in the Oval Office and Pena Nieto in Mexico City _ that Mexico and the United States had reached agreement on a new bilateral trade accord.
Pena Nieto had invited both Trump and the Democratic candidate, Hillary Clinton, to Mexico City in 2016. But only Trump accepted.
Pena Nieto upset his critics even more during the visit by failing to confront Trump about the wall issue and other instances of perceived Mexico-bashing.
At a news conference at the end of the visit, Trump heaped praise on Mexicans as "amazing" and "spectacular" people _ in contrast to earlier comments depicting Mexicans as drug traffickers, criminals and "rapists." But the softer tone did little to endear him to Mexico.
The public relations fiasco haunted Pena Nieto and contributed to his plummeting approval ratings.
His unpopularity, along with a sluggish economy and rising crime, led to the dismal showing of his Institutional Revolutionary Party in national balloting last month. It was the worst performance in the party's history.
Pena Nieto was not a candidate, because Mexican presidents serve just one term. But the ruling-party nominee lost in a landslide to President-elect Andres Manuel Lopez Obrador, who takes office Dec. 1.
In the video clip, Pena Nieto acknowledged that he had "underestimated the great social resentment" against Trump. He said that Trump's visit was "hurried," but insisted that it produced "positive" results in establishing a relationship with him.
At the time, Pena Nieto noted, Trump's anti-Mexican rhetoric was having an "impact on public finances" and had hastened a steady slide in the value of the Mexican peso. Trump had promised to revoke or revise the North American Free Trade Agreement, which governs more than $1 trillion in mostly tariff-free commerce among Mexico, the United States and Canada.
The Trump visit, Pena Nieto said, set the stage so "that today we have dialogue, we have communication," despite "enormous differences" with the Trump administration.
Trump continues to insist that Mexico will pay for a border wall. Mexico has said that will never happen.
Since Trump took office last year, the Mexican president has twice canceled planned visits to Washington, largely because of disagreements about the border wall issue.
During Monday's speakerphone spectacle, Trump called Pena Nieto his "friend," and the Mexican president proposed a tequila toast to mark agreement on the new trade pact. Pena Nieto signed off on the call offering an "affectionate hug" to Trump.
The new trade deal spurred considerable praise in Mexico for Pena Nieto and his lame-duck government, including from political opponents. Many here feared an economic collapse should a new trade regimen not be hammered out with the United States, which accounts for about 80 percent of Mexico's export market.
But street interviews here indicate that many Mexicans are still irate at Pena Nieto's perceived cozying up to Trump.
"So now you're telling me that Pena Nieto was a visionary and that he knew that the meeting with Trump would be good for Mexico?" asked Javier Morelos, 41, an engineer. "Please. Maybe your grandmother would believe that, but not most Mexicans ... . Trump hates us. Does Pena Nieto really have confidence in him?"
Added Martha Gonzalez, 48, a secretary: "Pena Nieto offered Trump a tequila, what is he thinking? You offer a tequila to a friend, not to someone who seeks to benefit themselves and doesn't care what happens to you."