The oil market has caught President Trump in an awkward spot between his pro-business instincts and his populist tendencies.

Trump, a major friend to the fossil fuels industry, took OPEC to task on Friday for the recent surge in oil prices. The price has climbed toward $70 in recent weeks, the highest in more than three years.

"Looks like OPEC is at it again," Trump tweeted. "Oil prices are artificially Very High! No good and will not be accepted!"

Trump is right that OPEC, the Saudi-led cartel, has orchestrated higher prices, as it's known to do. And millions of American voters will probably share the president's outrage if gasoline prices soar as a result.

Yet millions of Trump voters also live in states such as Texas, Oklahoma and North Dakota that depend on the oil industry for prosperity. The 2014-2016 oil price crash cost countless jobs and led to dozens of corporate bankruptcies.

Trump has pushed an agenda of American "energy dominance" by slashing environmental regulations and green-lighting pipeline projects.

"These oil-producing states are Trump red states. They're part of his coalition," said Joe McMonigle, senior energy policy analyst at Hedgeye Risk Management, an investment research firm. "To have energy dominance you need higher prices to support investment."

Trump has close ties to Harold Hamm, the billionaire who runs Continental Resources (CLR), a shale oil producer that benefits from higher oil prices. Hamm gave a primetime speech during the 2016 Republican convention, and Trump reportedly considered naming the CEO his energy secretary.

"The president is going to hear from Harold Hamm" about his tweet, said McMonigle, a top Energy Department official under former President George. W. Bush.

Continental Resources did not respond to a request for comment.

Trump portrays himself as pro-business, but he has also attacked major American companies like Amazon (AMZN), threatened to start a costly trade war with China and gone after drug makers for high prices.

Related: Forecast: You'll pay 14% more for gas this summer

Trump's attack on OPEC could also conflict with his efforts to improve relations with Saudi Arabia, the country pulling the strings at the oil cartel.

The timing of Trump's tweet is intriguing because OPEC's strategy hasn't changed recently.

What has shifted is the impact. Oil prices have soared 12% this year, and the price of gas has jumped to a national average of $2.75 a gallon.

That's partly because of production cuts by OPEC and Russia, which have successfully mopped up the huge supply glut that caused prices to crash. Officials from OPEC and Russia met on Friday to take a victory lap for their coordinated action.

"OPEC hasn't done anything different since early 2017," said Spencer Walsh, oil market analyst at IHS Markit.

"The tweet, in my opinion, is a little misleading and not fully factual," he said.

Trump himself shares blame for the more recent jump in oil prices. Geopolitical uncertainty briefly caused by US airstrikes in Syria helped lift prices earlier this month. Oil traders are also nervous about Trump's threats to reimpose sanctions on Iran, a move that could risk up to 1 million barrels per day of oil supply.

"A lot of the reason for higher prices is the president's policy on Iran," McMonigle said. "You're talking about a huge amount of oil at risk. You're going to see prices spike. That's US policy. It's not anything OPEC has done."

And then there's Venezuela, the crumbling OPEC country where instability has driven down production. The Trump administration is considering imposing oil sanctions on Venezuela that could further drive down supply.

"The thing that's kicked up the price is the geopolitical escalation, globally," Walsh said.

Related: Saudi oil shipments to America plunge to 1988 levels

Oil prices have also been lifted by resurgent appetite for energy around the world. Global oil demand grew during the first three months of 2018 by the most since late 2010, according to estimates by Goldman Sachs. The investment bank projected that Brent crude, the global benchmark, will rise to $80 a barrel this year, up from $75 today.

Trump's tweet noted that there are "record amounts of Oil all over the place."

Of course, OPEC and Russia are certainly not pumping at full capacity. Yet production in the US, driven by the shale oil boom, has climbed to record highs. The US is even expected to eventually topple Saudi Arabia and Russia as the world's No. 1 producer.

Trump has sought to encourage more production by cutting environmental regulations. He also advanced the controversial Keystone and Dakota Access pipelines.

What he can't do, at least by himself, is keep oil prices from rising to levels that hurt the economy and upset drivers.

"Other than presidential tweets," McMonigle said, "the federal government doesn't have a lot of tools at its disposal to affect prices."