Indians wait to deposit and withdraw their money outside an ICICI Bank ATM in Rajkot, India, Nov. 8, 2016. Reuters

Indian Prime Minister Narendra Modi surprised the nation Tuesday by announcing that all 500 and 1,000 rupee notes would be withdrawn from the banking system overnight in an effort to fight financial dishonesty.

In an unannounced speech on Indian television, Modi gave Indians 50 days to exchange their current notes for new 500 and 2,000 rupee notes. The move was designed to target corruption and illegal cash known as "dark money" being held unaccounted for, according to Modi, who said these were the "biggest obstacles in eradicating poverty."

"On one hand, we are number one in economic growth and on the other we are ranked 100 in global corruption rankings," he said.

"Despite various steps, we have improved only to 76."

Modi laid out a process by which Indians can exchange their money. Existing 500 and 1,000 rupees notes, the most common units of currency in the country, will only be accepted at essential institutions such as hospitals, airports and railway stations for 72 hours. Indians will have to deposit their old notes at banks or post offices before Dec. 30 with withdrawal limits at 10,000 rupees a day and 20,000 a week in the first few days.

Banks and post offices will also accept the exchange of up to 4,000 rupees until Nov. 24, however, Modi's speech did not specify whether this was daily, weekly or total. In order to accommodate the massive transition, ATMs will be closed Wednesday and, in some places, on Thursday. Banks too were reportedly surprised by the decision and will be closed Wednesday, as well.

"This is news for us also. I'm not aware how much stock we have in our chest. The Reserve Bank will have to provide us with required cash to meet the demand. The demand will be very high no doubt," an unnamed bank chief told Reuters.

India is the world's second largest population at around 1.3 billion people and the world's fourth largest economy, most of it in cash. The country has reportedly lost hundreds of billions of dollars as a result of illegal financial practices such as undeclared cash holdings and counterfeit bill production. Modi also accused militants of using fake money to fund terrorism in India.

The move is Modi's latest, and by far biggest, move to eliminate financial crime in India, a central promise during Modi's successful 2014 bid for prime minister. Modi raised nearly $10 billion in revenue last month by offering a tax amnesty to Indians holding undeclared income. Banks will be working authorities this time around to investigate suspiciously large amounts of cash. In his speech, Modi acknowledged the short-term frustration this new strategy would likely cause the public.

"In spite of all these efforts there may be temporary hardships to be faced by honest citizens. Experience tells us that ordinary citizens are always ready to make sacrifices and face difficulties for the benefit of the nation," he said.

Immediately after the announcement, Indians could reportedly be seen attempting to deposit and withdraw money from ATMs before they closed. Social media users have shared pictures of crowds surrounding the country's cash machines.