Two weeks ago in the Rose Garden, President Trump declared that under his leadership, foreign leaders won’t be “laughing at us anymore.”

Since then, he’s been the butt of jokes in capitals around the world.

In Mexico, former president Vicente Fox posted a profane video on YouTube, mocking Trump’s taste for taco bowls (“they’re not even Mexican!”) and border walls (“Mexico will not pay”) that has been viewed nearly half a million times.

In France, new President Emmanuel Macron unveiled a website titled “Make Our Planet Great Again” and invited U.S. scientists to move there, a week after Trump withdrew the United States from the Paris climate accord.

And in Australia, Prime Minister Malcolm Turnbull, who sparred with Trump in a testy phone call in February, this week treated a black-tie gala to a snarky impersonation of “The Donald,” referring to the Russia investigation and employing the president’s famous catchphrases.

(Emmanuel Macron)

“The Donald and I, we are winning and winning in the polls,” Turnbull said, prompting hearty laughter from fellow politicians. “Not the fake polls. They’re the ones we’re not winning in. We’re winning in the real polls. You know, the online polls.”

For Trump, the global trolling represents a mild rebuke for a president who had lambasted former president Barack Obama as feckless on the world stage and adopted a tough-guy persona aimed at putting “America first.”

Far from being cowed by Trump’s vow to achieve “peace through strength,” fellow world leaders appear emboldened to poke fun at him as a way to bolster their political standing. To a degree, the strategy is similar to one employed by Democrats, celebrities and some Republicans who have calculated that mocking Trump can boost their popularity.

“In the private conversations I’ve had with heads of states and ministers of foreign relations . . . they all feel what Turnbull just basically came out and said: This is, by far, the least capable person ever to sit in the office and it’s appalling they have to deal with him,” said Ian Bremmer, president of Eurasia Group, a global risk-assessment firm. “Even in a country that really needs to have a good relationship with the United States, you’re just not willing to deal with it. Your own ego will say, ‘Screw this guy.’ ”

White House officials did not respond to a request for comment.

Foreign leaders have been wrestling with how to deal with Trump’s norm-busting rhetoric since the campaign, when he questioned long-standing U.S. alliances in Europe and Asia, attacked Mexico, Japan and China on trade, and praised Russian President Vladi­mir Putin. Although heads of state tend to shy away from directly weighing in during a campaign, mindful of the need to work productively with whoever wins, some leaders felt compelled to speak out.

Among them were Mexican President Enrique Peña Nieto, who rejected Trump’s suggestion that his government would pay for a border wall, and then-Italian Prime Minister Matteo Renzi, who said during a meeting with Obama that the world’s future is about building “bridges, not walls.”

Others held their tongues, hoping to get off to a clean start with Trump after the new president assumed office. But it wasn’t long before some leaders began to lampoon Trump’s testosterone-laden approach to governing.

Perhaps the first to poke her thumb in his eye was Swedish Deputy Prime Minister Isabella Lovin, who in February posted a Facebook photo showing her signing a law surrounded by female aides — an image widely presumed as a retort to photos showing Trump signing executive orders flanked almost exclusively by men.

Last month, five Nordic leaders reenacted a photo of Trump where on his visit to Saudi Arabia he put his hands on a glowing globe, except they substituted a soccer ball in place of the orb.

“Who rules the world? Riyadh vs Bergen,” Norway Prime Minister Erna Solberg wrote in a caption on social media, saying that she and her colleagues were signaling support for “sustainability goals.”

For Trump, things have gotten so bad that he is now being trolled by those he has gone out of his way to praise, such as Putin, who on Thursday said with a straight face that he would offer asylum to former FBI director James B. Comey. Last month, Trump fired Comey, who was overseeing an investigation into the Trump campaign’s contacts with Russian officials.

Tamara Cofman Wittes, a senior fellow on Middle East policy at the Brookings Institution, said it is not unusual for U.S. allies and partners, especially those in Europe, to oppose U.S. policies or for their politicians to criticize the United States. But she added that “there’s a certain heft, a certain gravity that the preeminent global superpower carries with it in the world. The president embodies that more than anyone else.”

The trolling of Trump “is a bit the opposite of that,” Wittes said. “Does it mean that people don’t take the United States seriously? I don’t know. Maybe it means President Trump himself has demonstrated such a willingness to let it all hang out in public, every stray thought, that if you live such a public life you can’t be surprised if people pick it up and run with it, even if you’re president.”

Australian officials quickly attempted to squash the notion that Turnbull’s channeling of Trump was intended as a rebuke.

The two had tangled during a February phone conversation, during which Trump told Turnbull “this was the worst call by far” and hung up on him. A subsequent meeting between them in New York to clear the air was marred when Trump arrived three hours late.

A spokeswoman at the Australian Embassy in Washington said Turnbull’s remarks had been “taken completely out of context,” emphasizing that he was speaking at an off-the-record roast in the vein of the White House correspondents’ dinner.

Then again, Trump boycotted that dinner two months ago, where he was roasted in absentia by Daily Show comedian Hasan Minhaj.

“It’s questionable whether parodying the president at an event where it was almost certain to get out was a judicious thing to do, given the history,” said Andrew Shearer, an Asia security analyst at the Center for Strategic and International Studies who served as an adviser to former Australian prime ministers John Howard and Tony Abbott.

“We do know that he’s thin-skinned, and the risk is that he doesn’t take a joke,” Shearer said of Trump. “I would hope he would.”