MOSCOW/LONDON/SINGAPORE, Oct 6 (Reuters) - Russia's government on Friday lifted a ban on pipeline diesel exports via ports, removing the bulk of restrictions it enforced on Sept. 21.

Restrictions on gasoline exports remain in place.

Russia said on Sept. 21 it had temporarily banned gasoline and diesel exports to all but four ex-Soviet states in response to domestic shortages, a move that disrupted global trade that had already had to adjust to Western sanctions on Russian fuel exports.

WHAT HAPPENS NEXT?

The government said the lifting of restrictions applies to companies that supply at least 50% of the produced diesel fuel to the domestic market.

Russia produced 85 million metric tons of diesel last year, exporting some 35 million tons, including 25.6 million tons by Russian oil pipeline monopoly Transneft , according to LSEG data.

Restrictions on railway diesel exports remain in place, with the exception on exports to some ex-Soviet states.

Transneft on Friday said it would resume diesel exports via ports in the Baltic Sea and Black Sea once it receives clearance from authorities and when suppliers are ready, TASS news agency reported on Oct. 6.

A resumption of Russian diesel exports will have the biggest impact on Turkey and Brazil, Russia's two biggest buyers this year.

"With the lifting of the ban, Turkey may not need to import more Asian diesel barrels, but ultimately, it depends on how quickly Russia's diesel exports are restored," said Vortexa's head of APAC analysis Serena Huang.

Traders expect the lifting of the diesel ban could mean Asian diesel cargoes which would have replaced Russian exports in Africa and Turkey will now stay in the region, adding to already ample supplies.

HOW HAS THE MARKET REACTED?

European diesel futures spreads collapsed on the news. The 6-month backwardation fell by nearly 30% to $80.50 a metric ton. Backwardation is a market structure where future prices trade at a discount to current prices, and usually indicates tight supply.

European benchmark diesel refining margins fell sharply on Oct. 5 after daily Kommersant reported that the Russian government was ready to ease the diesel export ban in the coming days.

The diesel east-west arbitrage economics have also been affected, with the spread - determined typically by the exchange of futures for swaps (EFS) - falling to a discount $54 per ton on Friday after the announcement, a one-month low.

WHY DID RUSSIA IMPOSE THE RESTRICTIONS?

Traders said the fuel market in Russia, one of the world's biggest oil producers, was hit by a combination of factors including maintenance at oil refineries, bottlenecks on railways and the weakness of the rouble, which incentivises fuel exports.

Russia tried to tackle the diesel and gasoline shortages in recent months but turned to export curbs to prevent a fuel crisis, which could be awkward for the Kremlin as a presidential election looms in March.

Deputy Prime Minister Alexander Novak said on Oct. 4 that the restrictions were working, adding inventories had increased by 430,000 metric tons since they were introduced.

HOW LONG BEFORE THE GASOLINE BAN IS LIFTED?

Russia said exports would resume once it had stabilised its domestic market, but did not give a time frame.

Analysts, such as consultancy FGE Energy, had expected the ban on diesel to last up to two weeks before Russia replenishes its stocks and resumes exports.

FGE Energy said replenishing Russia's gasoline stocks could take up to two months.

The diesel ban will have the biggest impact because Russia is the world's top seaborne exporter of the fuel, just ahead of the United States.

It shipped an average 1.07 million barrels per day (bpd) of diesel from the start of the year to Sept. 25, accounting for more than 13.1% of total seaborne diesel trade, according to oil analytics firm Vortexa.

Russia is a much less significant gasoline exporter, shipping an average 110,000 bpd from Jan. 1 to Sept. 25, Vortexa said.

(Editing by William Maclean)