Gasoline prices have hit a four-year high going into the Labor Day holiday weekend, according to the Energy Department.

The Energy Information Administration's weekly oil and fuel data survey showed that the average price of regular gasoline for the nation was the highest it's been since Labor Day 2014.

"The U.S. average retail price for regular gasoline on August 27, 2018, was $2.83 per gallon, the highest price on the Monday before Labor Day since 2014, when it was $3.45/gal, and 43 cents/gal higher than the same time last year," the energy analysis agency said in its Week in Petroleum report issued Wednesday afternoon.

The agency said the "main driver" of the higher gasoline prices is the price of oil, particularly the North Sea Brent crude oil price, which is the benchmark for foreign oil imports into the United States.

The price of oil is almost $23 per barrel higher than what it was heading into the Labor Day weekend in 2017, the agency report explained. The oil price is also at the "highest level for this time of year since 2014," EIA said.

Crude oil is the main input affecting the cost of gasoline, along with changes in gasoline market conditions.

The agency said the high oil price has also coincided with high demand for gasoline.

The higher crude oil price environment coincides with a period of strong motor gasoline demand. The agency said new data from the U.S. Federal Highway Administration showed that cumulative miles driven in the first half of 2018 rose by 5.2 billion miles, or about 0.3 percent, from the same time period in 2017.

EIA's own fuel data reflected a similar upward tick in gasoline demand.

Gasoline product supplied in the first five months of 2018 averaged 9.2 million barrels per day, which is an increase of 0.2 percent compared with the same period last year.

Although the year-over-year increase in gasoline demand was greater in 2015 and 2016 when prices were lower, the amount of gasoline supplied to the market reached a record high in 2017. The sheer amount of fuel supplied to the market remains higher when compared with previous years at this time of year.