Average gas prices in California reached a new all-time high of $4.72 per gallon Wednesday. Analysts said prices could reach $5 per gallon over the next few months if the same trend continues.

The current national average for gasoline in the United States is $3.51 a gallon. California's prices have traditionally been among the highest, but they've risen dramatically in recent years, thanks in part to adjustments at major West Coast refineries.

Some facilities have closed, while others are being renovated to refine renewable fuels such as vegetable-oil-based diesel. Gas production on the West Coast has dropped from 2.5 million barrels per day at the beginning of the pandemic to only about a quarter this year.

 Analysts said the same factors that are affecting gas prices in California could also affect gas prices nationally over the next few months and years. The global head of energy analysis for the Oil Price Information Service, Tom Kloza, said the change in gas prices in California is merely a proxy of the massive energy transition that is now ongoing. He added that while shifting to renewable sources of energy will be greatly beneficial, it will not happen without pain.

Other states have also seen a sharp increase in gas prices in recent months. Washington, Nevada, and Oregon currently have average gas prices of around $3.90 per gallon, while Hawaii is the only other state with gas prices above $4 per gallon.

Data from the American Petroleum Institute shows that gas taxes and fees in California are among the highest in the country at 68 cents per gallon. This is significantly higher than the national average of 39 cents per gallon. California also charges additional taxes and carbon fees of around $1.35 per gallon on wholesale gas - a cost that is passed to consumers.

California's record-high gas prices are not just the highest price ever for the state but also the highest price of any state in the country. The highest price on record was $4.70 per gallon in Alaska, but it was set in July 2008, when a rise in oil prices resulted in a national average of $4.11 per gallon, which was a record at the time.

While the national average of $3.51 a gallon is far less than California's $4.72, the national price is rising at a quicker rate. Gas prices in the United States have risen by 6% in the past month and by 40% in the last year, whereas in California, prices have risen by only 2% in the previous month and 35% in the last year.

Kloza said he expects gas prices at some areas in California to reach $5 per gallon sometime within the second quarter. He added that if Russia does decide to invade Ukraine, gas prices could jump to $5 per gallon much sooner.