President Donald Trump has criticized the wisdom and expense of US military operations overseas.

As compensation, Trump has repeatedly suggested taking natural resources from the countries where US troops have been deployed.

The idea has been rejected by both US and foreign officials.

President Donald Trump has more than once expressed interest in being reimbursed for US military operations by the countries where those operations take place, and his focus on the issue reportedly earned him a rebuke from former national security adviser H.R. McMaster.

According to a report by Axios, during a summer 2017 phone call with Iraqi Prime Minister Haider al-Abadi, Trump brought up the idea of taking Iraqi oil as compensation for US expenditures in the country, which the US invaded in 2003 and has been present in ever since.

Trump previously mentioned the notion during the presidential campaign, saying the US should "take the oil," and he reportedly broached the topic again during a March 2017 meeting with al-Abadi at the White House.

Al-Abadi politely rebuffed Trump's inquiry during the March meeting, a source who was in the room told Axios. Trump mentioned it again during a phone call in summer 2017, which earned him reproach from McMaster.

Former national security adviser H.R. McMaster. Thomson Reuters

"We can't do this and you shouldn't talk about it. Because talking about it is just bad ... It's bad for America's reputation, it'll spook allies, it scares everybody," a source with direct knowledge of the exchange described McMaster as saying.

The source, who was not exactly sure of the phrasing, said McMaster argued the requests could've made the US look like "criminals and thieves" — saying, "that was the point [McMaster] was trying to get across."

"You won't be able to do it anyway and you'll harm our reputation and your own reputation just from talking about it," the source recounted McMaster saying.

Read more: Trump is attacking the French president for saying Europe needs to do more to defend itself — something Trump has also said they should do

McMaster, whose relationship with Trump was tumultuous, left the White House in early 2018.

Secretary of Defense Jim Mattis, who commanded Marines during the first Gulf War and the 2003 invasion of Iraq, said in February 2017 that the US was not in Iraq "to seize anybody's oil."

Trump mentioned the idea publicly in September 2017. "You're not stealing anything," Trump said at the time. "We're reimbursing ourselves."

Those comments drew criticism from many sides, including from Iraqis and their government.

US soldiers have been deployed in Iraq since 2003. 1st Lt. Leland White/US Army National Guard

Trump has questioned the wisdom of executing US military operations overseas — he referred to the war in Iraq and the subsequent reconstruction effort as "crooked as hell" — but has remained committed to them, increasing their intensity in some cases.

In Afghanistan, where Trump increased the number of US personnel after taking office, the president has also suggested recompense with the country's mineral resources.

While Afghan officials have not been as averse to the idea as Iraqi officials, pervasive insecurity in the country has prevented any kind of extraction effort.

Trump's criticism has extended to Iraqi officials. According to a former US official, after the March 2017 meeting at the White House, Trump jokingly referred to them as "the most accomplished group of thieves he'd ever met."