MUMBAI, India — It was a bold and risky gamble by Prime Minister Narendra Modi of India that quickly seemed to backfire.

The announcement of a ban on the largest currency bills circulating in India, which came into full effect at midnight Friday, the last day for depositing the old notes at banks, set off cash shortages that have hit the country’s most vulnerable people hard and prompted worries about the economy.

But despite those concerns, as well as doubts about whether the currency ban will reduce corruption as it is designed to do, for the moment, at least, Mr. Modi’s bet appears to be paying off in the public arena.

Even as the poorest Indians have struggled, many have continued to voice support for the prime minister’s initiative to target the vast amounts of untaxed money, known as “black money,” flowing through the country’s economy, in hopes that it will combat an endemic culture of corruption. Mr. Modi, analysts say, has successfully tapped into deep frustration with the corruption that pervades almost every public interface with government.