NEW YORK — Oil rewrote its 2016 peaks on Friday, barreling into higher 40 territory and toward multiweek gains on expectations of a production freeze by major exporters and stronger seasonal fuel demand in the US.

A rally in equity markets, on track to a fifth straight weekly gain, also boosted oil prices, with US energy company shares trading near three-and-a-half-month highs.

The dollar, on the slide since a more accommodativeUS monetary policy unveiled this week, traded near five-month lows, making many commodities, including oil, more attractive to users of currencies such as the euro.

"Focus for now is firmly placed on a global macroeconomic environment that is propelling other industrial commodities such as the metals as well as world equities back to around highest levels since late last year," said Jim Ritterbusch of Chicago-based energy markets consultancy Ritterbusch & Associates.

Brent crude was up 65 cents, or 1.5%, at 42.19 a barrel by 2.44pm GMT, after setting a 2016 high at 42.54. It was on track to a 4% gain on the week, its fourth straight weekly rise.

US crude rose 58 cents to 40.78 after setting the year’s high at 41.20. It was on course to gain 6% on the week for a fifth straight week of gains.

Oil has surged about 55% from 12-year lows after the Organization of the Petroleum Exporting Countries (Opec) floated the idea of a production freeze two months ago, boosting Brent from about 27 and US crude from around 26.

Opec kingpin Saudi Arabia and non-Opec producers led by Russia will meet in Qatar on April 17 to further the initiative that could result in the first global oil supply deal in 15 years.

US crude inventories hit a fifth straight week of record highs last week but the build of 1.3-million barrels was less than half of forecasts. Gasoline demand, meanwhile, jumped 6.4% over the past four weeks from a year ago.

"We are leaving the period of low demand and starting to move toward the period when demand increases over the summer," said Olivier Jakob, oil market analyst at Petromatrix at Zug in Switzerland.

The market is looking out for the US oil rig count due at 6pm GMT from oil services firm Baker Hughes to see if energy firms cut drilling activity again this week. The oil rig count has fallen the past 12 weeks while total oil and gas rigs are at 1940 lows.