NEW DELHI — Thousands of security forces were deployed on Thursday to keep the peace at India’s banks, where crowds of people had formed jittery, snaking lines in the early morning, desperate to exchange now-useless currency notes.

In a surprise move on Tuesday, Prime Minister Narendra Modi withdrew 500- and 1,000-rupee bills from circulation, aiming to shrink the country’s vast, informal “black” economy. The cash market, which by some estimates amounts to 30 percent of the gross domestic product, is used by many Indians to avoid paying taxes and to pay bribes.

For the next two weeks, citizens will be able to exchange 4,000 rupees a day, or about $60. But they will have difficulty converting large cash holdings because they will have to declare them to the tax authorities. Money that cannot be exchanged will be, as officials put it, “extinguished.”

The plan, top secret until Mr. Modi’s announcement, was hailed by financial analysts as bold and potentially transformational for India. It is also a high-stakes experiment: Though other Indian leaders have withdrawn currency notes, none have reduced the country’s supply of cash so drastically or so abruptly. The two bills being withdrawn make up 80 percent of the cash in circulation.