OPEC has agreed to cut its oil output for the first time since 2008.

The major oil producing nations struck a preliminary deal at talks in Algeria to address the vastly oversupplied market and prop up prices.

Brent crude, the international benchmark for oil, rose almost six percent to nearly $49 a barrel on the news.

Asian stocks gained on Thursday in tandem with an oil price rally after OPEC members agreed to curb… https://t.co/EjV5OStuyr#business — Nuusie Business (@Nuusie_Business) September 29, 2016

The move lifted the currencies of crude-producing countries and sent share indexes rising with energy shares leading the way.

A slump in oil prices has caused steep earnings losses for energy companies for several quarters.

Why OPEC Cut Should Mean Higher Oil, Higher Stock Market: Oil popped more than $3 from the lows of the … https://t.co/VBd9uCybCQ#tech — Mike Patel (@TheMehulPatel) September 29, 2016

Past attempts to reach an output deal have been complicated by political rivalry between Iran and Saudi Arabia. Riyadh had said it would only cut if other oil producers followed suit.

Iran had argued it needed exemptions until its production recovers after the lifting of EU sanctions.

How much each country will produce is to be decided at the next formal OPEC meeting in November.