President Trump on Wednesday marked the start of a three-nation regional trade deal in a Rose Garden ceremony with Mexican President Andrés Manuel López Obrador that took on a celebratory tone discordant with the widespread economic damage of the coronavirus pandemic.

The two populist-leaning presidents, from opposite ends of the political spectrum, signed a joint proclamation hailing the U.S.-Mexico-Canada Agreement, which took effect at the start of July, as the beginning of a new chapter in North America’s economic partnership.

The event represented an attempt by the White House at counterprogramming as Trump has faced tumbling public approval over his handling of the pandemic and the mass demonstrations for racial justice across the country. And it served as a reminder that the president had hoped to cruise to reelection on a strong economy — a strategy dashed as tens of millions of Americans have been forced out of work since March.

Canada was not represented at the signing after Prime Minister Justin Trudeau reportedly turned down an invitation. But Trump, who said he spoke with Trudeau by phone, and López Obrador lavished praise on one another and touted their unlikely partnership. Bilateral relations had frayed over immigration tensions before the leftist Mexican leader took office 18 months ago.

Trump thanked his counterpart for responding to U.S. pressure to help curb a major spike in unauthorized immigration last year, saying border control has “been very, very tight, and you’ve done a great job.” Border crossings began falling last year after Mexico adopted stronger new policies and the Trump administration took measures to speed deportations and try to block asylum seekers. The numbers continued to drop until last month, when they rose slightly.

López Obrador responded that Trump has “honored our position as an independent nation” and “behaved with kindness and respect.”

The positive comments from the two leaders on Wednesday were striking when compared with the tensions between the neighboring countries in recent years.

Trump was elected on an anti-immigration platform and said he would build a wall along the U.S.-Mexico border and force Mexico to pay for it. Mexico rejected that idea outright and U.S. taxpayers have funded the barrier, which is under construction. Last year, Trump also threatened to impose tariffs on Mexico if its leaders didn’t do more to prevent migrants from entering the United States. A deal was struck to avoid a trade war, but not without hard feelings on both sides.

Later in the day ahead of a dinner at the White House, López Obrador nodded at the past tensions in an attempt to minimize them.

“The forecasts failed. We didn’t fight. We are friends, and we’re going to keep being friends,” he said.

The bonhomie at the event did little to mask Trump’s political struggles. The president and his White House allies spent a second consecutive day on a public campaign to reopen schools this fall despite public health concerns from local jurisdictions and medical experts as nationwide virus infection rates have spiked to a record high of more than 50,000 per day. Trump and his aides disputed school reopening safety guidelines set by the Centers for Disease Control and Prevention as too muscular and suggested that they would be rewritten.

During his Rose Garden remarks, Trump offered an upbeat but inaccurate assessment of the administration’s response to the virus.

“We’re safely reopening the country and, more importantly, we’re safely reopening our schools,” he said, even though experts said that infection rates have increased as states have begun to restart business activity.

The three North American nations signed the USMCA in late 2018 after more than a year of negotiations that began when Trump threatened to pull the United States out of the North American Free Trade Agreement, a deal that had been in effect since 1994.

Analysts have said the new pact represents a modest reworking of the old deal, but Trump has touted it as a major improvement that will bolster American manufacturing.

“We’re already seeing the fruits,” Trump said.

The deal aims to reshape North American auto production by requiring that more work be performed in high-wage factories in the United States. But an independent assessment last year concluded that the agreement would have a limited effect on the overall U.S. economy.

In a 379-page report, the International Trade Commission said USMCA would boost output in the $21 trillion U.S. economy by just 0.35 percent. And modest gains in auto industry production and employment would come at the expense of other sectors, with production in the United States becoming more expensive and exports declining.

At the time, the administration disputed those findings, saying it was privy to confidential auto industry investment plans that promised greater rewards.

During a news briefing, White House press secretary Kayleigh McEnany called the deal “good for businesses as President Trump rebuilds the strongest, most inclusive economy in history. . . . It will help jump-start our economy.”

López Obrador’s decision to join Trump provoked some criticism in Mexico City that the trip — the Mexican leader’s first outside his country since taking office — could appear as an endorsement the conservative U.S. president in an election year. He took a commercial flight to Washington, sitting in coach and making a connection in Atlanta, a sign of López Obrador’s effort to distance himself from the perks enjoyed by past Mexican presidents.

“We had a good debate in my country about the convenience of this trip,” he said through an interpreter in the Rose Garden. “I decided to come because it’s very important to be launching this agreement. I also wanted to be here to thank the people of the United States and its government, and thank you, President Trump, for being increasingly respectful with” Mexico.

Though the two expressed confidence that the pact would pay dividends, experts have raised questions over how well some of the new trade deal’s core provisions will work out.

The Trump administration last year agreed to modify the deal under pressure from House Democrats, who were delaying ratification. New language was added at the 11th hour to make sure that Mexico implemented various domestic labor reforms, including granting workers the right to form independent unions.

In recent congressional testimony, Robert E. Lighthizer, the president’s chief trade negotiator, called USMCA “the best trade agreement in U.S. history” but acknowledged that enforcing the labor provisions would be tough.

The agreement includes a novel provision that would allow the United States to temporarily block exports from specific Mexican factories if it thinks worker rights were being violated there while awaiting a decision from an independent panel of experts.

Even as López Obrador arrived at the White House, there were signs of trouble on the labor front. Susana Prieto, a Mexican attorney representing workers in maquiladora factories near the U.S. border, accused the Mexican government of seeking to intimidate her with a prosecution on trumped-up charges.

Prieto, who has sought higher wages and changes to make factory work safer during the pandemic, was released from a Mexican jail on July 1. She had been held for three weeks on charges that included inciting a riot, after seeking to register an independent union. The terms of her release required her to leave the border region near Texas for the state of Chihuahua, hundreds of miles away. But prosecutors there also have warrants for her arrest, she said.

At a news conference, Prieto called López Obrador’s visit to Washington “completely inappropriate.”

Also on Wednesday, far from the White House, officials in Florida detained the former governor of Chihuahua state, Mexican officials said — in what amounted to a coup for López Obrador. While Trump didn’t mention the arrest of Cesar Duarte, it was widely seen in Mexico as a goodwill gesture from the White House. The Mexican president had promised to win the extradition of the notorious politician, who is wanted on corruption charges.

“A gift from the U.S. — the capture of Cesar Duarte” read the headline on the website of the daily Reforma. Duarte has been a fugitive since 2017.

Mary Beth Sheridan in Mexico City contributed to this report.