British Prime Minister Theresa May speaks at the Congress of Tomorrow Republican Member Retreat at Loews Philadelphia Hotel on January 26, 2017 in Philadelphia, Pennsylvania.

Joking that "opposites attract," Prime Minister Theresa May called on President Donald Trump on Thursday to renew the "special relationship" between Britain and the United States and lead in a new, changed world.

In the United States for what will be Trump's first meeting with a foreign leader since he took office last week, May signaled a shift in foreign policy, bringing her position more in line with that of Trump.

She urged the two countries and their leaders to stand united and confront new challenges, including the rise of economies in Asia that people fear could "eclipse the West," the threat of Islamic extremism and a resurgent Russia.

"So we - our two countries together - have a responsibility to lead. Because when others step up as we step back, it is bad for America, for Britain and the world," May told members of Republican Party at their retreat in a speech often punctuated by applause from an enthusiastic crowd.

"This cannot mean a return to the failed policies of the past. The days of Britain and America intervening in sovereign countries in an attempt to remake the world in our own image are over. But nor can we afford to stand idly by."

Her break with the interventionism that launched wars in Iraq and Afghanistan underscores a change in global politics. It also fits with Trump's move to put "America first" and scores well with voters in Britain whose feeling of being left behind by globalization helped fuel Britain's vote to leave the EU last year that propelled May to power.

Aware that Brexit will shape her legacy, May welcomed her early visit to the United States, a boost to her attempts to show that Britain can prosper outside the European Union despite criticism at home for cozying up to Trump.

On her U.S.-bound flight, May concentrated on similarities with the U.S. leader, who some reporters suggested had a style in stark contrast to her more cautious, restrained approach.

"Haven't you ever noticed ... sometimes opposites attract?" she answered with a laugh.

Trade

Eager to win favor -- and a trade deal -- with the new U.S. president to bolster her hand in the divorce talks with the European Union, May said both countries shared many values and that, contrary to his statements that NATO was "obsolete," Trump had told her he was committed to the U.S.-led military alliance.

May said she supported Trump's "reform agenda" to make NATO and the United Nations "more relevant and purposeful than they are today," and "many of the priorities your government has laid out for America's engagement with the world."

But there may be sticking points in Friday's talks - May said she condemned the use of torture and would stick to UK policy, suggesting Britain may not accept intelligence that could have come from such methods that Trump could reintroduce.

"We condemn torture and my view on that won't change – whether I'm talking to you or talking to the president," she said when asked what impact it would have if Trump brought back a CIA program for holding terrorism suspects in secret prisons.

May will have navigate the middle ground carefully, wary of being criticized as too pro-Trump or alternatively as too negative toward a future trading partner.

She has threatened to walk away from the EU if she fails to get a good deal, and some critics say that could give other countries, like the United States, the upper hand in any talks.

And the EU might not take kindly to any overly friendly overtures to a president some of the bloc's main leaders have voiced concern about.

Some kind of trade agreement, though, is high on her list of priorities, despite Britain and the United States being at odds over genetically modified organisms, meat production and public procurement and May unable to sign deals until after Brexit.

May says she will launch the divorce talks by the end of March by triggering Article 50 of the EU's Lisbon Treaty, which gives up to two years to negotiate an exit deal. Only then can she agree with third countries.

Both leaders should use the time to find areas where they could remove trade barriers, May said.