The price of gasoline has risen for two weeks in a row to a national average of $1.93 a gallon, up 40 cents from a year ago, after falling for six consecutive weeks at the beginning of the summer.
"We do not expect a substantial drop in retail prices between now and Labor Day, and probably beyond," the Energy Information Administration said in its weekly review of the oil market.
The Energy Department's analytical arm said "it would not be surprising" to see retail motor fuel prices fluctuate near current levels for the next few weeks.
The agency said it was surprising that U.S. gasoline inventories increased 2.5 million barrels last week, because fuel stocks are usually drawn down at this time of year.
However, the EIA said crude oil costs are the main factor setting the price of gasoline, as oil accounts for almost half the cost of making motor fuel.
The price of crude has shot up about $4 a barrel in recent weeks because of traders' concerns about supplies and political unrest in the oil-rich Middle East.
In late trading at the New York Mercantile Exchange, oil for delivery in September was up 16 cents at $40.60 a barrel.
The 3.6 million barrel decline in the latest weekly U.S. crude oil inventory numbers "could put a brake" on any downward move in oil prices, the EIA said. But the agency pointed out that more oil is on the way as OPEC has promised to pump additional crude during August and Saudi Arabia boosted its oil output this month.