Gasoline prices rose on Wednesday, touching their highest levels since late August, when Hurricane Harvey devastated the Gulf Coast, knocking out a quarter of U.S. refining capacity.

The jump in gasoline futures followed President Donald Trump's announcement on Tuesday that he is withdrawing the United States from the 2015 Iran nuclear deal. The Trump administration immediately restored sanctions on Iran, OPEC's third-largest oil producer.

Gasoline futures on the New York Mercantile Exchange rose as high as $2.169 on Wednesday, the highest level since August 31. That day, futures spiked as high as $2.1705, after days of severe weather and flooding in the heart of the nation's refining hub on the U.S. Gulf Coast.

Wednesday's rally mirrored a surge in crude oil, the raw material for gasoline and other fuels. U.S. West Texas Intermediate and international benchmark both hit 3½-year highs as the market parsed the American exit from the nuclear deal.

Gasoline prices will likely head higher, but not necessarily because of Trump's nuclear decision, said Tom Kloza, global head of energy analysis at Oil Price Information Service. Instead, the run-up primarily relates to supply and demand, in his view.

Kloza expects global demand for petroleum to outpace supply by about 1 million barrels a day by the middle of the year.

"We don't have a gasoline glut. We don't even have a comfort zone," Kloza told CNBC's "Closing Bell" on Tuesday.

"It's not long term, but you're going to have higher numbers, and you could have drastically higher numbers if you have tropical storm weather during the summer," he added.

During the 2018 driving season, the average American family will pay $200 more for motor fuel compared with last year, Kloza estimates.

The average price at the pump for a gallon of regular gasoline was about $2.83 on Wednesday, nearly 49 cents more than at this time last year, according to AAA.