At a news conference following talks at the Prime Minister's country residence, Trump said: "The relationship between our two nations is indispensable to the cause of liberty, justice, and peace."
He also said that "whatever" Britain does after it leaves the EU is "OK with us" as long as the US and UK can continue to trade together and called Brexit an "incredible opportunity", the BBC reported.
"Once the Brexit process is concluded, and perhaps the UK has left the EU - I don't know what they're going to do, but whatever you do is OK with me. That's your decision. Whatever you're going to do is OK with us. Just make sure we can trade together. That's all that matters," Trump said.
On her part, the British leader said they had discussed plans for an "ambitious" trade agreement.
However, Trump's comments were in stark contrast to what he said in an interview to the Sun tabloid that was published on Thursday.
He had said that May had ignored his advice on Brexit and warned that the UK will probably not get any future trade deal with the US, if it goes ahead with May's plan for post-Brexit ties with the European Union.
Trump said May's plan would "probably kill the deal" as it would mean the US "would be dealing with the EU" instead of with the UK.
But later, Trump criticised the Sun's report by calling it "fake news". "I didn't criticize the Prime Minister. I have a lot of respect for her. And unfortunately, there was a story that was done, which was, you know, generally fine. But it didn't put in what I said about May. And I said tremendous things."
He said he had not given May advice on how to deal with the EU but "did give her a suggestion... and I think she found it maybe too brutal". Trump added that he had a recording of the interview and it would support his argument.
Meanwhile, thousands of people were protesting in central London against his visit. A large balloon, portraying the President as a baby, was floated in Parliament Square as part of the demonstrations. Other protests were due to take place across the UK on Friday and Saturday.
May has been making the case for a US free trade deal with Trump, on his first UK visit as President. She said the US was "keen" to do a deal with the UK, adding: "We will do a trade deal with them and with others around the rest of the world".
She maintained the government's Brexit agreement "delivers" on the referendum vote.
Earlier, Trump said he and May had spoken for an hour-and-a-half at the black-tie dinner, which he attended with his wife Melania at Blenheim Palace on Thursday evening. "I think we probably never developed a better relationship than last night," he said.
(This story has not been edited by Business Standard staff and is auto-generated from a syndicated feed.)