President Trump is beating up on the oil cartel OPEC, but experts say his own policies are partially to blame for rising oil prices that could lead to higher gas prices just months before the midterm elections.

In June, the Trump administration said it would take a zero-tolerance approach to enforcing sanctions on Iran after it abandoned the nuclear agreement with Iran in May. The White House wants countries to stop importing oil from Iran by November, and if that happens, most are expecting higher prices for oil and gas.

“These are two polar opposite extremes, if Trump wants to cut off 2.4 million per day of oil and have prices stay stable if not go down,” said Richard Nephew, a senior research scholar at at Columbia University’s Center on Global Energy Policy who directed sanctions policy at the State Department in the Obama administration.

“I am not aware of there being sufficient spare capacity to being able to make that up,” Nephew added. “The only way this gets resolved is higher prices. That's simple math."

Iran is OPEC’s third largest producer, and sells around 2.4 million barrels a day, or more than 2 percent of global supplies, since the lifting of sanctions in 2016.

Since a Trump administration official suggested a zero-tolerance policy with Iran on June 26, the price of Brent crude oil, the international benchmark, rose from $74 to $77, and the U.S. benchmark oil price jumped from $66 to $74.

U.S. gasoline prices were an average of $2.87 on Friday, down a bit from the four-year high they hit on Memorial Day.

Experts say the White House's zero-tolerance policy has the oil market expecting the worst, which is why oil prices keep rising and why gas prices are expected to follow.

“The thing that is moving oil prices upward is the sentiment of what the Trump administration wants to see removed from the market, which seems like pretty much everything,” said Sarah Ladislaw, senior vice president and director of the Energy and National Security program at the Center for Strategic and International Studies.

Trump has directed his anger at OPEC, and its chief member, Saudi Arabia, which collectively agreed last month to boost oil production by 1 million barrels per day to compensate for lost crude elsewhere. But Trump says OPEC didn't go far enough, and expects the oil cartel to do more to make up for the Iranian oil exports he wants to shut down.

“He focuses on the oil revenue to Iran as being key to getting leverage, to either renew the nuclear deal or put pressure on them to change their behavior," said Joseph McMonigle, president of the Abraham Group, a consulting firm, and a former chief of staff of the Energy Department in the George W. Bush administration. "He rightly expects Saudi Arabia and other Gulf states who support the Iran policy will make sure U.S. gasoline prices don't go up as a result. From a political standpoint, he wants some cover.”

“What the president is trying to do is live in a world where his priorities are the world's priorities, and his priorities are to reduce Iranian oil from the market and figure out a way in which prices can still be low,” Ladislaw added.

One factor that could put the market at ease is Saudi Arabia's increased production of 10.5 million barrels per day of crude oil last month, an increase of 458,000 barrels per day from what it produced in May. That number could grow in July.

"I think you will see a big shock production number close to 11 million barrels per day in July," McMonigle said. "Once the market sees that, things will settle down.”

Another is whether the world really stops accepting Iranian oil exports as Trump wants. China could be the hardest to wean off Iranian oil, analysts say, and may look to buy Tehran’s oil at a discount after U.S. sanctions spook other purchasers.

A third factor is whether other countries could help make up the difference. The United Arab Emirates, Kuwait, Iraq, and Russia, along with Saudi Arabia, could help make up for loss of Iran’s supply, the International Energy Agency said.

The U.S. is unlikely to be able to do much on its own. The U.S. is producing a record amount of oil, but analysts say it is in less of a position to help make up for lost Iranian crude, because of pipeline constraints in Texas and New Mexico.

“Shale might not be able to help out much,” Nephew said. “The U.S. is not like the Saudis where they could switch oil production on-off more or else. It’s just going to take time that Trump may not want to wait for.”