TEHRAN — Iran’s lame-duck Parliament approved a bill on Wednesday canceling cash subsidies to 24 million Iranians, angering the government of President Hassan Rouhani, local news outlets reported.

Analysts said the action was a stick in the eye for Mr. Rouhani from the conservative-dominated Parliament, forcing him to figure out how to put the unpopular measure into effect.

However, with sagging oil prices cutting Iran’s national income, the International Monetary Fund and other groups have warned that Tehran will have to cut back the system of giving monthly cash payments to nearly all of its 80 million citizens or risk running huge deficits.

As such, the Parliament’s action places Mr. Rouhani in a difficult position, economists say. Canceling the subsidies is a critical part of any economic overhaul, something that Mr. Rouhani has promised to undertake. But the measure is likely to add to growing complaints over his handling of the economy.