LONDON -- Making nice at the end, U.S. President Donald Trump eased up Tuesday on his frequent criticisms of outgoing British Prime Minister Theresa May over her handling of the tortured Brexit deal, declaring that history will remember her fondly if the United Kingdom can successfully leave the European Union.

The latest chapter in the allies' storied "special relationship" played out as anti-Trump protesters -- with the infamous Trump baby balloon bobbing overhead -- thronged the streets of nearby central London.

The president's unexpected compliments for May come just days before she was set to resign the leadership of her party after failing to secure a Brexit deal. She will depart as prime minister once her successor has been chosen.

"I have greatly enjoyed working with you. You are a tremendous professional and a person who loves her country very much," Trump told May at a news conference near the prime minister's Downing Street office. But he couldn't resist a slight dig, evoking the two years of broadsides he had lobbed at her by recalling that he had urged her to sue the EU rather than try to negotiate a departure.

Trump said he would have "sued and settled, maybe, but you never know. She's probably a better negotiator than I am." And he added that the deal May came away with was a good one and "perhaps you won't be given the credit you deserve."

May voiced hope her successor will be able to achieve Brexit.

"I still believe --I personally believe-- that it is in the best interest of the U.K. to leave the European Union with a deal. I believe there is a good deal on the table," she said. "Obviously, it will be whoever succeeds me as prime minister to take this issue forward. What is paramount, I believe, is delivering on Brexit for the British people."

Earlier in the day, Trump jokingly suggested that May "stick around" until a new U.S.-U.K. trade deal was brokered. May and her aides chuckled at that.

Trump said Britain and the U.S. would be able to strike a "phenomenal trade deal" once the U.K. had left the EU -- music to the ears of pro-Brexit Britons. But, in words sure to alarm those in Britain concerned about Brexit, he said that "everything"-- including the National Health Service -- would be "on the table" in future trade negotiations. In a later interview that will air Wednesday on ITV's "Good Morning Britain," Trump appeared to back away from that idea, saying he didn't envision the health service being part of the talks, adding, "That's not trade."

Most Britons are protective of the state-run NHS, which delivers free health care to all, and many worry that private U.S. health care firms could try to gain access to chunks of it as a condition of a trade deal.

On a separate issue, Trump said he anticipated "no limitations" on the future sharing of intelligence with the U.K. as the U.S. continues to press its longtime ally to ban Chinese company Huawei amid espionage and trade concerns.

Traditionally, U.S. presidents avoid injecting themselves into the domestic politics of other nations. But Trump didn't hold back -- right after claiming that he would not comment on Britain's internal matters.

He renewed his praise of Conservative lawmaker Boris Johnson, who is campaigning to replace May as Conservative leader, and of another contender, Foreign Secretary Jeremy Hunt. He said he'd turned down a requested meeting from Labour Party leader Jeremy Corbyn and took new swipes at one of his most vocal critics, London Mayor Sadiq Khan.

Afterward, Brexit Party leader Nigel Farage and Trump met at the U.S. ambassador's residence, with Farage tweeting that they'd had a "good meeting."

Trump previously had voiced support for a "hard Brexit," which could have a devastating impact on the U.K. economy, according to many experts. That stands in contrast to a previous White House position that the departure should be as painless as possible. Others in the U.K. are pressing for a second referendum that could keep Britain in the EU.

As the pageantry of Trump's British state visit gave way to politics, an economic meeting between the leaders at St. James's Palace brought together 10 leading companies -- five from the U.K. and five from the United States. CEOs and senior representatives from BAE Systems, GlaxoSmithKline, National Grid, Barclays, Reckitt Benckiser, JP Morgan, Lockheed Martin, Goldman Sachs International, Bechtel and Splunk were listed as attending.

While the corporate leaders gathered, protesters began to assemble across London. Leaders of Britain's main opposition party joined demonstrators at a rally in Trafalgar Square, just up the street from May's Downing Street office. Also in Trafalgar Square: a 16-foot robotic likeness of Trump seated on a golden toilet.

Trump glossed over the protests, saying he saw "thousands of people in the streets cheering" and waving U.S. and U.K. flags, but just a "very, very small" group of protesters. "There was great love," he said.

Trump and first lady Melania Trump later toured the Churchill War Rooms, the British government's underground command centre during World War II. Then it was time for a fancy reciprocal dinner that the Trumps hosted at the U.S. ambassador's residence for Prince Charles, his wife, Camilla, and other dignitaries.

On the menu: heritage tomatoes with burrata, grilled filet of beef and vanilla ice cream with summer berries.

A day earlier, Trump had lunch with Queen Elizabeth II and tea with Prince Charles before a grand state dinner at Buckingham Palace.

------

Associated Press writers Gregory Katz in London and Darlene Superville and Deb Riechmann in Washington contributed to this report.