President Donald Trump’s oil and gas investments have gained millions of dollars during the first six months of the war with Iran, even as US forces have suffered military losses and the conflict has pushed up the cost of energy and military operations.A CNBC analysis of Trump’s annual financial disclosure, quarterly corporate reports and FactSet market data found that his nine largest oil and gas holdings gained between $1.5 million and $4.4 million between the start of hostilities and August 31.The estimate covers Trump’s holdings in Chevron, ConocoPhillips, Exxon Mobil, Kinder Morgan, Marathon Petroleum, Occidental Petroleum, Phillips 66, Valero Energy and Williams Companies.CNBC calculated the potential gains using share-price movements from February 27 closing price, the day before hostilities began, through the August 31 close.Trump’s oil holdings gained as oil prices surgedThe value of the holdings rose as the Iran conflict disrupted energy markets and intensified concerns around oil supplies and shipping through the Strait of Hormuz.On Wednesday, Iran said it had attacked 10 ships near the Strait of Hormuz after the US sank five Iranian oil tankers, marking the largest declared wave of retaliatory attacks on shipping since the six-month-old war began.The latest attacks sent oil prices higher, with benchmark Brent crude futures moving above $100 a barrel for the first time since July. The companies in Trump’s portfolio have also reported substantially higher profits. According to CNBC’s analysis of corporate filings, the nine companies together recorded $47.6 billion in second-quarter profit, compared with $15.9 billion during the same period a year earlier.Trump’s accounts also showed 23 sell transactionsTrump’s financial accounts showed buying activity and at least 23 sell transactions involving the nine oil and gas stocks through June 29, the last date covered by any trade disclosure on record, CNBC reported.The outlet, however, made it clear in its reporting that it found no indication that Trump or his investment managers acted on inside knowledge of his decisions or that his financial interests influenced US policy.A separate August report by Democrats on the congressional Joint Economic Committee estimated that Trump’s wider oil and gas holdings could have increased in value by as much as $15.5 million so far this year.The committee also calculated that Americans had paid approximately $71.5 billion more for gasoline since the war began, equivalent to about $604 per household.US forces have suffered losses during the warThe financial gains in Trump’s oil portfolio come against the backdrop of continuing US military casualties and equipment losses. As of September 9, the Defense Casualty Analysis System recorded 14 US service members killed and 417 wounded in action under Operation Epic Fury, the initial phase of the US-Iran conflict that began February 28.Seven of the deaths were classified as hostile and seven as non-hostile. The wounded included 279 Army personnel, with the remainder from the Navy, Air Force and Marines, including active-duty, Reserve and National Guard members.A broader tally that includes “Overseas Operations” casualties had reached 18 total US deaths and more than 750–820 wounded by early September.US military has lost dozens of aircraft and dronesThe conflict has also taken a toll on US military equipment. A Congressional Research Service report released in May put confirmed US aircraft losses and damage during Operation Epic Fury at at least 42 aircraft, alongside billions of dollars in ground infrastructure losses.The aircraft and uncrewed systems listed in the report include four F-15E Strike Eagles, one damaged F-35A Lightning II, one A-10 Thunderbolt II, seven KC-135 Stratotankers, one E-3 Sentry AWACS, two MC-130J Commando IIs, one damaged HH-60W Jolly Green II, 24 MQ-9 Reapers and one MQ-4C Triton. Iranian missiles and drones were responsible for some of these losses, while one of the most consequential incidents involved so-called friendly fire.The war is costing Washington billionsThe equipment losses form only one part of the financial burden of the conflict. The Washington, DC-based Center for Strategic and International Studies (CSIS), in its June report, estimates the war has cost approximately $40 billion, with a range from $34 billion to $42 billion.CSIS divides the costs into six categories: deployment and redeployment, munitions, higher operational tempo, equipment losses, base damage and higher fuel prices.