Prices at a Chevron gas station in Menlo Park, California, on Tuesday, May 24, 2022.Prices at a Chevron gas station in Menlo Park, California, on Tuesday, May 24, 2022.

The average price for a gallon of gasoline went above $5 for the first time in history due to increased demand and a lack of oil due to the war inUkraine.

Analysts think prices will continue to rise into the summer.

The average price for a gallon of gas in the US was $5.004 on Saturday. The price is a record not adjusted for inflation. At the end of the week, prices had averaged $5 or more in about 20 states, with the highest prices on the west coast.

The average household is spending more on gas a month than they did a year ago. That is a large bite.

The average price of a gallon of gas is about 65 cents higher than a month ago, but it usually peaks in May. According to analysts, prices may not top out until mid-July due to short supplies.

Patrick DeHaan, head of petroleum analysis at GasBuddy, thinks we are close to the highest prices. I don't think it would be as high. The market is crazy and I think $5.25 is the top.

If there are refinery issues this summer, gasoline prices could go up.

The US has lost 1 million barrels a day of refining capacity because of the swine flu. The sanctions on Russian energy have resulted in tight supplies of both oil and fuel around the world.

While consumers are feeling pain at the pump, analysts say the price of fueling a car with gasoline is not as important as it used to be. More efficient vehicles are to blame.

Even with the steep price increases, drivers were spending an estimated 20 cents per mile on gasoline, according to a CNBC analysis. It would have cost 30 cents in 1980.

Nicholas Wells made a contribution to this report.