US President Donald Trump launched a rare public criticism of the military methods Israel has been employing in Lebanon to target Hezbollah fighters, saying it is not necessary to bomb entire residential buildings in pursuit of militants.

Trump, who over the past few days expressed his displeasure at Israeli strikes on Beirut that he said could have threatened his deal with Iran, said Israel has been fighting Tehran-allied Hezbollah for "longer than necessary."

Speaking at the G7 summit in France on Tuesday, Trump said: "Far too many people are being killed. You don't have to destroy a residential building every time you're looking for somebody, because there are a lot of people in those residential buildings, and they're not all Hezbollah."

His criticism comes as tensions between him and Israeli Prime Minister Benjamin Netanyahu escalate — a relationship that has remained a key political alliance despite the ups and downs it has seen over the years.

Tensions have sharpened recently. Israeli officials have been quietly expressing their frustration over the deal the Republican president struck with Iran, while Trump's patience with Netanyahu over the Israeli strikes on Beirut has been wearing thin, as those strikes prompted Iran to launch attacks at a time when Trump was putting the finishing touches on a peace deal with Tehran.

Trump indicated he has a "wonderful relationship" with Netanyahu, but said at the same time that Netanyahu must be "more responsible" regarding Lebanon. He added: "Without us, without the United States, there would be no Israel. And without me, there would be no Israel, because no other president was willing to do what I did."