Britain's Prime Minister Theresa May acknowledges applause before speaking during the 2017 “Congress of Tomorrow” Joint Republican Issues Conference in Philadelphia on Jan. 26, 2017. (Mark Makela/Reuters)

British Prime Minister Theresa May told congressional Republicans on Thursday that the election of President Trump had ushered in “the dawn of a new era of American renewal,” and said the United States and Britain could “lead together again” in a modern world fraught with uncertainty and danger.

Addressing the GOP members of Congress at their annual retreat, May walked a tightrope between praise for and criticism of the new administration’s emerging foreign policy, alternating between support for some of the positions Trump has staked out and a clear rejection of others.

She urged engagement with Russia but to “beware” of its president, Vladimir Putin. She defended the value of NATO and the United Nations, while acknowledging they need changes to meet current-day needs. She criticized Iran’s support of the government in the Syrian civil war and its “malign influence” in the region, but defended the nuclear deal as deterring Tehran from building a bomb.

May said the United States and Britain were working together to defeat the ideology of “Islamist extremism,” but in an aside suggested she does not back the idea of banning visitors and refugees from majority-Muslim countries.

“We should always be careful to distinguish between this extreme and hateful ideology and the peaceful religion of Islam, and the hundreds of millions of its adherents,” she said. “Nor is it enough merely to focus on violent extremism. We need to address the whole spectrum of extremism, starting with the bigotry and hatred that can so often turn to violence.”

Many of May’s remarks were met with enthusiastic applause and standing ovations — even more than when Trump spoke before the group earlier in the day. On Friday, May will be the first foreign leader to visit the White House since Trump was sworn in, and she spoke repeatedly of the special relationship between the United States and Britain, epitomized by the friendship between Republican president Ronald Reagan and the Conservative prime minister Margaret Thatcher.

Another common theme was the alienation many Americans and Britons feel in an era of globalization, helping sweep Trump, and May before him, to power. Part of May’s mission is to promote trade between the two countries, as Britain prepares to leave the European Union.

“People, often those on modest incomes living in relatively rich countries like our own, feel that the global system of free markets and free trade is simply not working for them in its current form,” she said.

The speech gave May the opportunity to present Republicans with a sweeping vision of what she depicted as their shared conservative worldview — one built on liberty, open markets and universal rights. To make her case, she repeatedly invoked the three great heroes of conservative transatlantic history — Churchill, Reagan and Thatcher.

She also used language notably more partisan than that of her predecessors, hailing the November election as an opportunity for American renewal.

“Because of that great victory you have won,” she told the Republicans to loud applause, “America can be stronger, greater and more confident in the years ahead.”

But amid her lavish praise were constant reminders of just how far Trump has deviated from the conservative worldview she described.

On trade, security, multinational institutions and most conspicuously on Russia, May laid out stances that are in keeping with a long tradition of Western consensus — but that Trump has unceremoniously discarded.

By raising the differences without explicitly naming them, May almost seemed to be willing Trump to return to the fold of traditional transatlantic foreign policy.

Less than a week after Trump proclaimed “America first” and suggested a shrinking global mandate for the United States, May informed the crowd that “Global Britain” intended to take on an “even more internationalist role, where we meet our responsibilities to our friends and allies, champion the international cooperation and partnerships that project our values around the world, and continue to act as one of the strongest and most forceful advocates for business, free markets and free trade anywhere around the globe.”

As if to underline just how far that vision is from Trump’s, as she spoke the White House threatened to slap a 20 percent tariff on Mexican imports amid a dispute over who will pay for the president’s planned border wall.

Unlike Trump, a vociferous critic of alliances and multilateral institutions, May defended organizations such as the United Nations, NATO and even the E.U.

In contrast with Trump’s protectionism, she gave an enthusiastic endorsement of free trade — and aggressively plugged the U.S.-British trade deal she hopes that she and Trump can ultimately reach.

The most jarring difference between May and Trump, however, was on Russia. Although Trump has appeared eager to win over Putin, May urged caution. She offered support for nations in the Baltics that have been menaced by Russia and cited “the illegal annexation of Crimea” as legitimate reasons for them to feel afraid. Although Trump has questioned whether the United States should come to the defense of NATO allies in the event of an attack, May was unequivocal.

“We should not jeopardize the freedoms that President Reagan and Mrs. Thatcher brought to Eastern Europe by accepting President Putin’s claim that it is now in his sphere of influence,” she said in a line that received thundering applause.

“When it comes to Russia, as so often, it is wise to turn to the example of President Reagan who during negotiations with his opposite number, Mikhail Gorbachev, used to abide by the adage, ‘Trust but verify,’ ” she said in a speech that drew repeated rounds of applause and ovations.

“With President Putin, my advice is to ‘engage but beware.’ ”

May also said she thought that Britain and America should never again invade foreign countries.

“The days of Britain and America intervening in sovereign countries in an attempt to remake the world in our own image are over,” she said.