NEW DELHI — For the second time in 18 months, India has a shortage of cash. And like last time, economists say, it’s primarily the government’s fault.

Empty A.T.M.s and bank restrictions on withdrawals have been reported in eight states this week, and some bank managers said the cash crunch had been building for months.

The government says the cash problem was caused by an unusual spurt in demand and will be eased within days. But if it persists, the shortage poses a political threat to Prime Minister Narendra Modi, whose administration has been hit in recent weeks by a series of stumbles. Most recently, he was criticized for his long silence over the horrific gang rape and murder of an 8-year-old Muslim girl that the police say was committed by a group of Hindu men to terrorize the Muslim population.

On Monday, Sampath Kumar Lohati drove his scooter around Warangal, a city in the south Indian state of Telangana, for more than four hours trying to withdraw money.