California had its largest single-day gasoline price spike in almost five years Thursday, leading to long lines at the pump, gas shortages and even station closures.

Experts said the price increases could continue for weeks and the average might even break the $5 mark. Already by Thursday afternoon, at least five Los Angeles area gas stations had crossed the $5 per gallon mark, according to GasBuddy.com, including one charging $5.29 per gallon in Burbank and another at $5.11 in Norwalk. One station in Calabasas was even charging $5.69.

A refinery closure, a contaminated pipeline and the state’s strict pollution limits are all, in part, to blame, experts said. Gasoline inventories across the state are lower than they have been in more than 10 years.

The cost of gasoline in California jumped 8.3 cents Thursday to $4.32 per gallon, up 18 cents over last week, according to the AAA’s Daily Fuel Gauge. The national average Thursday was $3.78.

This set California as the most expensive U.S. state in which to buy gasoline.

Kloza said it was likely that California’s record average gasoline price of $4.61 a gallon, set in June 2008, would be broken.

The average price of gas Thursday in Los Angeles was reported at $4.35 a gallon.

Patrick DeHaan, senior petroleum analyst at GasBuddy.com, said California prices should continue to rise as retail prices catch up with wholesale prices.

“Wholesale prices have gone up $1 a gallon in the last week alone, and retail prices have only followed for 30 cents, so there unfortunately is room for retail prices to climb, and that’s likely what they’ll do,” DeHaan said.

In recent weeks, California refineries have dropped production in anticipation of switching over to a “winter blend” of gasoline, which emits more polluting emissions, next month.

California’s summer-blend fuel requirements are in effect in Southern California until Oct. 31.

The California Independent Oil Marketers Association, a Sacramento-based group that represents wholesale and retail fuel marketers, asked the state Wednesday to expedite a waiver that would allow refiners to produce and sell winter-grade fuel, said spokesman Jay McKeeman.

“Everybody is concerned about what might happen,” he said. “The real question is: How long is this going to last and what can the state do?”

At the same time, a power outage at ExxonMobil Corp.’s 150,000-barrel-per-day Torrance refinery Monday and a shutdown of the crude distillation unit at Chevron Corp.’s Richmond refinery contributed to the tight supplies.

Gesuina Paras, an Exxon spokeswoman in Torrance, said the refinery may burn off flammable gas released by pressure relief valves for a week as it restores production following a power failure that shut down some units and slowed output from others.

Chevron also has had problems with a refinery and a pipeline.

The Kettleman-Los Medanos pipeline, which carries 85,000 barrels per day of crude oil from the state’s Central Valley to refineries in the San Francisco Bay Area, has been closed since mid-September due to the presence of elevated organic chloride levels in the crude stream.

In addition, Chevron’s 240,000-barrel-a-day Richmond plant, the largest refinery in Northern California, has been running at reduced capacity since a fire Aug. 6.

Adding to California’s gasoline woes, maintenance work at the Phillips 66 plants in Rodeo and Arroyo Grande has slowed production as well.

“It’s a series of unfortunate events,” Kloza said. “This is not something that is going to last for months. This is something that is going to last for days or weeks.”

“The squeeze is on, and people are doing desperate things,” said Van der Valk. “The mom and pop gas stations are having to close down from either not being able to obtain gasoline from their regular distributor or cannot afford the break-even price of almost $5 per gallon.”

McKeeman said the independent gas station owners are typically the first to run out of fuel and shut their pumps when spot prices surge because they often lack long-term contracts to buy from fuel suppliers at set prices, McKeeman said.

Gasoline station owners in Southern California have stopped making wholesale purchases to fill their underground tanks since the price of gas has shot up in the past week, he said.

Even the Costco discount store chain, which typically has some of the cheapest prices, is starting to run dry or is seeing long lines at its pumps.

Customer Jorge Reveles, 67, of Fontana hoped to fill his gas tank after shopping at Costco in Fontana, but he learned that wouldn’t be a likely possibility once he drove up to the closed gas pumps.

“I have no idea what’s going on,” Reveles said. “I thought I’d be getting gas here today, but I guess I’ll have to drive down the street.”

Costcos throughout the region also stopped selling gas Thursday, including in Montclair, Simi Valley, Northridge, Alhambra and Azusa.

At Costco locations that did have gas, lines of vehicles were waiting to fill up Thursday.

At the Lakewood location near Clark Avenue and Candlewood Street, lines eight cars deep were waiting at all 15 pumps.

Customers said the lines aren’t unusual and happen throughout the week because of the low prices.

“The gas here is cheaper than anywhere else,” said Helen Ford of Long Beach.

On Thursday, the Lakewood Costco was charging $4.17 a gallon.

Costco’s shortage has to do with the company being an independent gas provider.

Companies with their own refineries, such as BP, Shell, ExxonMobil, Valero, Tesoro and Sinclair, don’t have to find gasoline on the open market, as independent gas providers do, DeHaan said.

“It’s not surprising Costco is having a tough time finding gasoline, and other independents may have the same situation,” DeHaan said. “That just shows the severity of the situation, which unfortunately solidifies why prices are rising, and that’s because of limited supply.”

However, Van der Valk called the price surge “a short-term problem” and said that wholesale costs should start falling as Exxon’s refinery returns to normal operations and other plants finish maintenance.

In the meantime, though, drivers and gas station operators will continue to feel the squeeze.

“We’re not going to wake up tomorrow and find out this is a bad dream. It’s real life, and unfortunately there is a clear potential for California to set a new record state high price,” DeHaan said. “Even though that’s not much consolation for those folks out there facing the pump, this will blow over, but it will take a matter of weeks until we see any relief.”