Asked what his advice was for Brexit, Trump replied: "He needs no advice. He's the right man for the job. I've been saying that for a long time. It didn't make your predecessor happy..." Trump's undiplomatic outbursts often targeted Johnson's predecessor Theresa May. Johnson replied that Trump's backing was "on message there".
A new US-UK trade deal after Britain leaves the EU was at the heart of their meeting and both men appeared upbeat about the chances of success after Johnson a day earlier urged Trump to remove the "considerable barriers" impeding UK companies exports to the US.
Johnson promised that "we are going to do a fantastic deal once we clear some of the obstacles in our path".
Trump replied that a "very big trade deal, bigger than we've ever had" was possible "quickly".
In the lead-up to the talks, Johnson had appeared at pains to distance himself from Trump after facing accusations in the past of being too cosy with the American leader.
He had also said that US digital giants like Facebook and Google needed to be taxed "fairly and properly" on their revenues.
The three-day meeting of the Group of Seven nations that started on Saturday was marked by EU leaders rounding on Trump over his escalating trade war with China and tariff threats to the EU.
But Trump denied there was any ill-will and called an impromptu lunch on a hotel terrace French host Emmanuel Macron on Saturday "the best meeting we have yet had".
"Before I arrived in France, the Fake and Disgusting News was saying that relations with the 6 others countries in the G-7 are very tense, and that the two days of meetings will be a disaster," Trump tweeted on Sunday morning.
"Well, we are having very good meetings, the Leaders are getting along very well, and our Country, economically, is doing great - the talk of the world!" he added.
But Johnson registered his disapproval of Trump's trade war with China, which EU leaders have warned is hitting economic growth around the world and risks causing recessions.
"Just to register a faint, sheep-like note of our view on the trade war -- we are in favour of trade peace on the whole," Johnson said.
Asked if he had second thoughts about his move to further escalate with additional tariffs on China, Trump indicated he was perhaps rethinking his latest actions. "I have second thoughts about everything," he said.
The Basque resort of Biarritz, which at this time of year usually teems with surfers, sunbathers and tourists, has been turned into a fortress for the event with over 13,000 police on duty and its gleaming beaches out of bounds to the public.
An anti-capitalism demonstration in nearby Bayonne turned ugly Saturday when the crowd of several hundred tried to get through police barricades and was repelled with water cannon and tear gas.
The British leader will also have a midday meeting with EU Council President Donald Tusk after a bitter verbal spat the day earlier.
The talks could prove to be prickly after the pair exchanged barbs on Saturday over who would be to blame if Britain left the European Union without a deal.
"I still hope that Prime Minister Johnson will not like to go down in history as Mr 'No Deal'," Tusk told reporters in Biarritz.
G7 summits, gathering Britain, Canada, France, Germany, Italy, Japan and the United States, were once a meeting of like-minded allies. But they've become a diplomatic battlefield under Trump.
In a radical break from previous meetings of the elite club, there is to be no final statement.
Macron has also invited several world leaders from outside the G7 such as India's Narendra Modi and Egyptian President Abdel Fattah al-Sisi who will join the meeting on Sunday.
G7 chiefs are also hoping to soothe tensions over Iran's nuclear programme and persuade Trump to ease his policy of "maximum pressure", for example by lifting sanctions on Iranian oil sales to China and India.
Macron is also pushing for action against fires in the Amazon rainforest, despite Brazilian right-wing President Jair Bolsonaro's angry response to what he sees as outside interference.