Moscow is trying to divert fuel supplies to the domestic market and bring down prices.

Russia has introduced a temporary ban on exports of gasoline and diesel to all countries except four ex-Soviet states in order to stabilize the domestic market, the government said Thursday.

It said the ban, which takes effect immediately, did not apply to fuel supplied under inter-governmental agreements to members of the Moscow-led Eurasian Economic Union, which includes Belarus, Kazakhstan, Armenia and Kyrgyzstan.

“Temporary restrictions will help saturate the fuel market, which in turn will reduce prices for consumers,” the Russian government said in a statement.

The energy ministry said the measure would prevent unauthorized “gray” exports of motor fuels.

In recent months Russia has suffered shortages of gasoline and diesel. Wholesale fuel prices have spiked, although retail prices are capped to try to curb them in line with official inflation.

The crunch has been especially painful in some parts of Russia’s southern breadbasket, where fuel is crucial for gathering the harvest. A serious crisis could be awkward for the Kremlin as a presidential election looms in March.

Traders say the Russian fuel market has been hit by factors including maintenance at oil refineries, bottlenecks on railways and the weakness of the ruble, which incentivizes fuel exports.