Enter multiple symbols separated by commas

July 4 prediction: Gas prices to be highest in 6 years

Patti Domm | CNBC

Gas prices are expected to be at the highest level in six years for the Fourth of July holiday, but they could start to fall if Iraq oil production remains secure, analysts said.

The current national average is $3.68 per gallon, with most gas prices 3 to 10 cents higher than they were when Sunni militants overtook the city of Mosul in Iraq, earlier this month.

"We're going to see the highest July 4th prices since 2008, and we probably wouldn't have, if it weren't for Iraq," said Tom Kloza, chief oil analyst at GasBuddy.com. "I certainly would not rule out if something happens near Basra or south of Baghdad, we would see national prices make a pass at $4...but I just don't see a fuel apocalypse in North America this year."

If Iraq production is not cut, he said the biggest threat to gas prices would be the potential for hurricanes this summer. "Without hurricanes, the last 100 days of the year, we'll start talking about how cheap gasoline is," he said.

The U.S. has been producing about 8.4 million barrels of oil a day, and has been importing about 7 million. That has been a factor keeping a lid on prices, he said.

"The supplies (of refined product) over the last couple of weeks have been increasing, as refiners move back to service," said Andrew Lipow, president of Lipow Oil Associates. "I think we're actually going to see stable to slightly declining gas prices as we go into the fourth of July holiday. One reason we haven't seen a greater decline is the violence in Iraq has propped up the crude oil price."

Kloza said crude prices are being supported by large speculative positions in oil futures, which he estimated at a record $50 billion more bet on higher prices in the WTI contract. West Texas Intermediate was at $105.74 per barrel Friday.

The fact that the U.S. is producing so much more crude and now feeding east coast refineries with cheaper North Dakota crude instead of African crude is also helping U.S. gas prices, he said.

"In order to see $5 a gallon prices in the United States, you would need to see $175 a barrel domestic crude, and I don't believe you could see that simply on the loss of Iraqi crude," Kloza said. "You might see world prices go that high but we're not that far from North and South American oil independence."

Kloza said some states put taxes on gasoline starting July 1 and that could push the national price slightly higher before it starts to come down. If not for Iraq, he said the price would peaked for the year in late April.

—By CNBC's Patti Domm. Follow her on Twitter @pattidomm.