Trump labelled Italy a "key partner" in both trade and anti-terrorism efforts, at a news conference following talks to prepare for the G7 leaders' summit in Sicily.
The US president said it was a "great honour" to meet the Italian leader and that their two countries had "a deep link and a strong friendship".
But though Trump defined the USA and Italy as "vital allies", particularly when it came to fighting terror, he appeared to disagree with Gentiloni on the role of the US in stabilizing Libya.
Moments after Gentiloni described American involvement as "critical", Trump said that he did not see any role for the US in Libya.
"I think the United States has enough roles," said Trump. He was not wearing an earpiece to provide him with a translation of Gentiloni's very different response, according to media reports.
The US president also spoke about plans for meeting Pope Francis during his upcoming trip to Italy next month.
"I look very much forward to meeting the Pope," said Trump.
Leaders normally give the Holy See several months' notice when requesting a papal audience, and it was not clear whether the pontiff would be meeting Trump, following months of barbed exchanges between the two men who have very different world views.