Donald Trump has warned Boris Johnson he may be unable to reach a Brexit agreement with Brussels because the European Union are such tough negotiators.
The Prime Minister said he was "marginally more optimistic" about the possibility of getting a deal after talks in recent days with Europe's key players.
But after his debut on the world stage at the G7 summit in Biarritz, US president Mr Trump suggested Mr Johnson could struggle - even though he will be a "great Prime Minister".
"They may have to get out, they may not make a deal," Mr Trump said.
"The European Union is very tough to make deals with - just ask Theresa May."
Mr Trump, who held a first formal meeting with Mr Johnson in Biarritz, said he poked fun at the Prime Minister over the time it had taken him to finally get into Number 10.
"I really believe that Boris Johnson will be a great Prime Minister," he said.
"We really like each other. And we had a great two and a half days.
"I have been waiting for him to be Prime Minister for about six years.
"I told him, 'what took you so long?'"
He added: "I think his time is right, it's the right time for Boris."
Responding to Mr Trump, the Prime Minister said while the EU were tough negotiators "that doesn't mean we won't do a deal".
"It will be difficult, there is a substantial disagreement but my job is to make our case," he said.
Mr Johnson repeated his demand for the backstop, the contingency plan to retain close ties with the EU to prevent a hard border with Ireland, to be scrapped.
He has held talks in recent days with Germany's Angela Merkel, France's Emmanuel Macron and European Council chief Donald Tusk, which have left him more upbeat about the prospect of reaching an agreement.
But major stumbling blocks remain, with opponents of a no-deal Brexit also mobilising in an attempt to prevent Mr Johnson meeting his pledge of leaving on 31 October come what may.
Labour leader Jeremy Corbyn will convene a meeting of no-deal critics on Tuesday before Parliament returns from its summer recess on 3 September.
The Prime Minister repeatedly refused to rule out suspending Parliament in an effort to force through a no-deal Brexit.
But at the summit's closing press conference he said: "I think it's the job of everybody in Parliament to get this thing done.
"I think it's what the people want, I also think, by the way, it's what our friends and partners on the other side of the Channel want - they want it over.
"They are very enthusiastic about getting on with the future. They regard Brexit now as an encumbrance, an old argument. They want to talk about the new partnership that we're going to build."
The Prime Minister used the G7 summit to hold first meetings with a range of leaders and to advance talks on potential trade deals.
After meeting the Prime Minister, his Australian counterpart Scott Morrison suggested a trade deal with the UK could be done within a year.
"You've just got to get round the table and work it through," he said.
"I'm not going to create any arbitrary deadlines on this."
And Mr Johnson also said there "big, big opportunities" from a trade deal with the US.
But he said he would rather have a "comprehensive deal" rather than a quicker but smaller agreements focusing simply on goods and agricultural and food products.