After taking a trip below $3 a gallon for much of January, gasoline prices in the Twin Cities area are on the way up and may keep rising at least through Memorial Day.

On Thursday, a gallon of gas at many metro area filling stations had already hit $3 and scores of others were poised to cross the threshold. Overnight, prices in the seven-county metro area rose a penny a gallon to an average of $2.98. The most expensive gas was in Ramsey County, where the average price for a gallon of gas was $3 even. The cheapest was $2.95 a gallon in Washington County, according to AAA's daily survey of gas prices.

Outside the metro area, gas is going for $3.09 in Watonwan County in south central Minnesota, which was the most expensive in the state, AAA said.

The national average on Thursday was $3.15.

The incremental price hike can be attributed to several factors, said Patrick De Haan with the gas price tracking website Gasbuddy.com. Cold weather in January that briefly knocked refineries in the South offline, other refineries conducting maintenance operations and tensions in the Middle East have sent gas prices on a slow but upward trajectory.

"That has been enough to move us off those seasonal lows," De Haan said. "I do think this is the calm before the storm."

Minnesotans could see a slight reprieve in coming weeks as refineries seek to divest themselves from winter grade oil, which could bring another round of discounted prices. But as refineries switch over to summer blend, as they usually do in mid-February, prices are certain to go up, De Haan said.

"We normally see an average increase of 35 to 85 cents from Valentine's Day to Memorial Day," De Haan said. "I hope we would not be on the high side of that range, but it's possible."

If that transpires, a gallon of gas could be in the upper $3 a gallon-range just as peak travel season begins in May.

U.S. oil production at near-record levels could mitigate any steep price increases, De Haan said, but conflicts overseas could adversely affect gas prices, too.

"That is a wild card," De Haan said.

The long-term picture is not clear either. Midwest refineries have imported crude oil from Canada at discount prices, but that source of cheap oil could be ending. Canada is expected to complete work on the Trans Mountain Pipeline in 2024 and divert oil bound for the U.S. to Vancouver, where it can be loaded on ships and sold on the international market. That could make the price of a barrel of crude $10 to $15 higher, De Haan said.

"That will be bad for consumers in the Midwest," De Haan said.