Donald Trump suggested Sir Keir Starmer should involve the military in tackling the small boats crisis as he warned illegal migration could "destroy countries “from within”.
The US president said he had discussed the UK’s efforts to control illegal migration with Sir Keir at a joint press conference held by the two men at the end of his two day state visit.
He highlighted his own record in securing the borders in the US and suggested the UK faced a similar challenge.
Trump said: "What I saw happening, with millions of people pouring into our country, I couldn't stand to watch it, and we've done a great job."
He said: "The last three months we had zero - from millions of people a year ago, we had zero people enter our country illegally."
Speaking alongside Sir Keir at the Prime Minister's country residence Chequers, he said: "I think your situation is very similar. You have people coming in and I told the Prime Minister I would stop it, and it doesn't matter if you call out the military, it doesn't matter what means you use.
"It destroys countries from within and we're actually now removing a lot of the people that came into our country."

Sir Keir pointed to action including the first return under the one in, one out deal with France which took place on Thursday morning, just hours before the Prime Minister's talks with Mr Trump.
The Prime Minister said: "This is obviously an issue we're taking incredibly seriously."
There had been a "record number of returns" of people with no right to be in the UK.
"We struck the returns arrangement with France, and notwithstanding the challenges to that scheme, which you've seen in the last few days, a flight went off at 6.15am this morning, successfully returning someone under that scheme," Sir Keir said.
"So that is an important step forward. Obviously, there's no silver bullet here. There's a range of things that need to be done, but given the challenges of returning people, it is important we're able to prove it can be done."
It was the "proof of concept" and "now we need to ramp that up at scale", he added.
Sir Keir, Trump answered questions on freedom of speech, immigration and the war in Ukraine at the press conference.
He accused Vladimir Putin of “really letting me down” over his failure to end the war in Ukraine.
The president said he “did not like to see” people continuing to die in the conflict.
He suggested he had initially thought the war, which he previously claimed he could end within one day of entering the White House, would have been "the easiest" to settle because of his relationship with Putin.

But a peace deal appears to be no closer despite months of Washington-led talks, and Mr Trump's ultimatums and deadlines for the Russian leader to engage have passed without obvious consequences.
Trump said: "I'm very honoured to tell you that we've solved seven wars, seven wars, wars that were unsolvable, wars that couldn't be negotiated or done, the US has done seven of them.
"The one that I thought would be easiest would be because of my relationship with President Putin, but he's let me down.
"He's really let me down.”
Both leaders faced questions about freedom of speech.
Sir Keir was asked about arrests in the UK over offensive social media posts and the controversy surrounding new laws introduced under the Online Safety Bill.
He replied: “Free speech is one of the values of the United Kingdom, and we protect it fiercely and always will... I'm also protecting children from things that will harm them, paedophiles, those that peddle suicide, which has had a terrible consequence for individuals, particularly teenagers.”

Trump was questioned about TV presenter Jimmy Kimmel after his late-night talk show was suspended when he made comments about the fatal shooting of Charlie Kirk.
Kimmel was "fired for a lack of talent", the President said.
Addressing the controversy over Kimmel’s comments, Trump added: "He said a horrible thing."
Sir Keir added: "On the question of Charlie Kirk, can I just express how shocking that is, I think, to everybody who believes in free speech and in democracy.
"It sent shockwaves through the world and I know that he was a friend of the president, and I reached out straight away to the president, because I understood how impactful it would be on him and his family, and we all need to be absolutely clear about that: whatever our political views, it is shocking and is to be condemned."
Trump dodged questions about Lord Peter Mandelson being sacked as US ambassador over his relationship with Jeffrey Epstein.
The US President said "I don't know him" when asked whether he had sympathy with the former diplomat for being fired over historic links to the paedophile financier.
Turning to Sir Keir, Trump asked: "What is your answer to that?"
The Prime Minister said: "Well, I mean, it's very straightforward. Some information came to light last week which wasn't available when he was appointed. And I made a decision about that."
Trump has battled rumours about his own friendship with Epstein, with claims the President contributed to a 50th birthday book for the sex offender, who died in 2019.
He said the letter, surrounded by an outline of a woman's body, was not made by him and has a fake signature.

Photographs of Trump with Epstein were projected on to Windsor Castle on Tuesday ahead of a lavish state banquet in which the King hosted the President on Wednesday.
Four men were arrested over the stunt.
Trump concluded his state visit today with the visit to the Prime Minsiter’s Buckinghamshire country estate.
Earlier on Thursday he signed a tech prosperity deal, which will see US firms invest in the UK and boost co-operation on AI, quantum and other emerging technologies.
Mrs Trump had earlier joined the Queen for a tour of Queen Mary's Doll's House and the Royal Library in Windsor Castle.