The past couple of weeks, however, saw Mr. Trump seal a revised trade agreement with South Korea and replace the North American Free Trade Agreement with Canada and Mexico, which not long ago seemed as though it might be beyond his reach. The continuing fall in unemployment to 3.7 percent was built on the recovery he inherited from Mr. Obama — something he refuses to acknowledge — but the booming economy has become one of his strongest political assets. And with Judge Kavanaugh nearing confirmation on Saturday, he showed he could push through an important nomination that many predicted was likely to fail after allegations of sexual misconduct.

“It’s a wonderful week. We’re thrilled,” Kellyanne Conway, his counselor, said in an interview. “It shows that his perseverance and his tenacity and his adherence to campaign promises and principles are paying dividends.”

Some Republican activists said Mr. Trump had shown that defying conventional wisdom could work.

“President Trump has made a ton of gambles,” said Ben Domenech, publisher of The Federalist, a conservative news site. “Most of them have paid off. Even a bad gambler can get on a hot streak. The measure of a good gambler is what happens when the dice cool down.”

The cause for celebration in the White House, of course, was cause for mourning among his opponents. In the view of his critics, he will be putting a man credibly accused of sexual assault on the nation’s highest court, he blew up friendships with America’s neighbors for a new trade deal whose actual impact has been exaggerated, and he has appropriated credit for the economy from Mr. Obama while ballooning the deficit in a way that conservatives have until now always condemned.

James J. Blanchard, an ambassador to Canada under President Bill Clinton, attended the groundbreaking of a new bridge between Detroit and Windsor, Ontario, on Friday and said that Prime Minister Justin Trudeau of Canada “was upbeat” following the new trade deal. Mr. Trump was right to update the trade agreement, he said, although “it probably could have been done six months ago without the cheap theatrics,” and now “everyone knows we need to repair relations, but no one expects Mr. Trump to do that.”