There were angry protests as people rushed to buy petrol

Windows were smashed and stones thrown at the stations, and there was traffic chaos as motorists queued to buy fuel.

Iranians were given only two hours' notice of the move that limits private drivers to 100 litres of fuel a month.

Despite its huge energy reserves, Iran lacks refining capacity and it imports about 40% of its petrol.

The country has a large budget deficit largely caused by fuel subsidies and the inflation rate is estimated at 20-30%.

The BBC's Tehran correspondent, Frances Harrison, says Iran is trying to rein in fuel consumption over fears of possible UN sanctions over its nuclear programme.

Iran fears the West could impose sanctions on its petrol imports and cripple its economy.

'Dangerous move'

The restrictions began at midnight local time on Wednesday (2030 GMT Tuesday) and are set to continue for four months - with a possible extension to six months - the government said.

There is anger that the government did not give people more notice. Some MPs have called for an end to the rationing and parliament may postpone its summer recess to deal with the crisis.

During the night, cars were set alight and petrol stations vandalised while, in the capital, a supermarket and a bank were also attacked.

"Guns, fireworks, tanks, [President] Ahmadinejad should be killed," chanted angry youths, throwing stones at police.

The protests are the first large-scale outpouring of anger against the Iranian government since Mr Ahmadinejad took office in 2005.

Iran's petrol is heavily subsidised, sold at about a fifth of its real cost.

The price of 1,000 rials ($0.11) per litre makes Iran one of the cheapest countries in the world for motorists.

So far there has been no announcement about whether Iranians can buy more petrol at the real market cost.

Licensed taxi drivers will be able to buy 800 litres a month at the subsidised price.

US pressure

Our correspondent says rationing fuel is only likely to add to high inflation.

It is a dangerous move for any elected government, especially in an oil-rich country like Iran, where people think cheap fuel is their birthright and public transport is very limited, she says.

The US, which is leading efforts to pressure Iran to suspend its uranium enrichment activities, has said Iran's fuel imports are a point of "leverage".

Washington and other Western nations accuse the Islamic Republic of seeking to build nuclear weapons.

Iran says its nuclear programme is entirely peaceful and is solely aimed at producing civilian nuclear power.