If you haven’t filled up in the last couple of days, be prepared: The average price of regular unleaded gas topped $4 a gallon in the Bay Area and could go much higher.

Premium gas already was selling at $4.20 on Thursday, but you could still get regular at some stations for $3.99.

The average price for regular gas was $4 a gallon in Oakland and $4.05 in San Francisco on Friday. The statewide average hit $3.99 a gallon — second highest in the country after Alaska’s $4.04. A year ago, the price or regular unleaded gas cost just more than $3 a gallon. The California average rose 1.3 cents a gallon overnight to $3.993.

“When there’s higher demand, prices go up,” said Cynthia Harris, spokeswoman for AAA Northern California. “There’s tremendous unrest and strife in the Middle East, and these are the major crude oil producers in the world. There’s a lot of speculation as to how this will affect production and distribution of crude oil on the global level.”

Harris said Japan is also a factor in rising gas prices because it will have a much higher need for crude oil and natural gas as it fights to recover from a 9.0 earthquake and devastating tsunami.

As painful as all of that might seem, historically the highest average gas prices were in 2008, when the cost for regular unleaded was $4.58 in San Jose, $4.57 in Oakland and $4.62 in San Francisco, according to AAA. Some stations might charge more; some might charge less.

“Prices could continue to rise,” Harris said. “We are into our summer blend that is produced in March. Summer gasoline is more expensive because of the additives they add to it.”

Investors in crude oil also play a role in gas prices — as concern about future supplies grow, so do prices.

For the future, “we’re sort of in a wait-and-see mode,” Harris said. “Chances are we will continue to see spikes in gasoline prices over the next few months.”

In a video clip recorded by a student, a psychology instructor at Orange Coast College told her class that the election of Donald Trump was “an act of terrorism” – prompting an official complaint from the school’s Republican Club.