A handful of big one-day losses during July pushed the oil market to its biggest monthly decline in two years — and the source of those big swings can often be traced back to the White House.

Supply and demand for oil are roughly in balance, so traders have been sensitive to any headlines that could tip the market into oversupply or shortage. Lately there has been no shortage of news, in part because of President Donald Trump's penchant for unexpected comments on Twitter, as well as his administration's effort to impose sanctions on Iran, the world's fifth-biggest oil producer.

"Welcome to a headline-driven market," said John Kilduff, founding partner at energy hedge fund Again Capital. "It's duck and cover and keep an eye on your Twitter feed."

U.S. crude prices actually rose in 13 of the month's 21 sessions, while Brent is also up in 13 of the 22 trading days. However, most of the one-day gains were moderate, with both benchmarks jumping more than $1 a barrel only once this month.

Meanwhile, Brent lost nearly $11 over three sessions spread throughout the first four weeks of July. U.S. crude lost almost $8 over as many days during the same period. A final day of heavy losses on Tuesday meant both futures had their worst monthly drop since July 2016.

Heading into the month, oil prices had rallied strongly after a State Department official told reporters the Trump administration was pushing oil buyers to cut their purchases from Iran to zero by Nov. 4. Trump restored sanctions on Iran in May, but the deadline for winding down imports was more aggressive than the market had anticipated and raised fears of oil shortages.

July 2: Trump tweets about Saudi supply pledge

But a few days later, on July 2, Brent crude dropped nearly $2 a barrel after Trump declared on Twitter that Saudi Arabia's king had agreed to pump up to 2 million more barrels per day to tame fuel prices. The White House later walked back that claim, saying the king would take an increase under consideration.

TWEET

That same day, Reuters forecast that Saudi Arabia's oil output had jumped by 700,000 bpd in June. Meanwhile, Russia's energy minister said it had boosted its production back above 11 million bpd that month. Both headlines suggested that Saudi Arabia and Moscow were making good on their vow to raise output to prevent the market from overheating.

July 5: Crude stockpiles rise, and Trump tweets at OPEC

Two days later, WTI had its first big drop for the month, falling $1.20 a barrel after weekly data showed a surprise jump in American crude stockpiles.

Earlier in the day, Trump lobbed the latest in a series of Twitter critiques at OPEC, ordering the world's cartel to reduce prices immediately. That fed speculation that Trump was getting impatient with relatively high fuel prices and considering selling oil from the nation's emergency supply. (A week later, details of a plan to do just that leaked.)

@realDonaldTrump: The OPEC Monopoly must remember that gas prices are up & they are doing little to help. If anything, they are driving prices higher as the United States defends many of their members for very little $'s. This must be a two way street. REDUCE PRICING NOW

July 11: Libya and Saudis provide relief, Trump slaps tariffs on China

Brent and U.S. crude both logged their biggest daily drop for the month on July 11, after Libya resolved a major disruption to its crude exports and Saudi Arabia reported a nearly 500,000 bpd jump in its oil output. Brent fell $5.46 a barrel, while U.S. crude ended the day down $3.73.

Also that day, oil prices fell in tandem with stock markets after the Trump administration slapped tariffs on $200 billion of Chinese goods. The trade dispute between the nations — home to the world's two biggest economies — has weighed on oil markets because it threatens to slow global growth and cool demand for crude.

July 16: Treasury secretary eases Iran supply fears

The final big drop came on July 16, with U.S. crude down nearly $3 a barrel and Brent dropping almost $3.50.

That day, Treasury Secretary Steve Mnuchin eased the market's concerns about oversupply, saying the administration would consider allowing some oil buyers to reduce their purchases from Iran more gradually. Mnuchin told reporters the administration wanted to avoid roiling oil markets as it pursued its Iran policy.

July 31: OPEC and Russia resurgent, Trump says he'd meet with Iran

On Tuesday, U.S. crude fell $1.37, or 2 percent, a barrel to $68.76, down 7.3 percent this month. Brent fell 1 percent toward $74, down about 6.5 percent in July. The latest declines came as a Reuters survey of analysts forecast another jump in OPEC's output for July and Russia said its oil production would hit a 30-year high above 11 million bpd this year.

"There's been this rush to put more oil on the market by the Saudis and Russia, so I think in the near term, it's a negative because we haven't lost any of the Iranian barrels yet," Kilduff said.

Some believe Trump's comment on Monday that he'd meet Iran's president with no pre-conditions took some of the geopolitical risk premium out of oil prices. However, Kilduff noted that Iranian officials have dismissed Trump's remark.

U.S. Secretary of State Mike Pompeo also appeared to hedge in a CNBC interview, listing several conditions for a summit with Iran.