Indians woke up to deserted streets on Wednesday as the government began the gargantuan task of keeping 1.3 billion people indoors during a Hindu holiday season to prevent the coronavirus from rapidly spreading across the subcontinent.

Prime Minister Narendra Modi’s announcement of a three-week countrywide lockdown covering nearly one-fifth of the world's population triggered panic buying on Tuesday night, but the situation eased after the government issued notices that essential services would be provided.

In recent days, India had gradually expanded stay-at-home orders, banned international and domestic flights and suspended passenger service on its extensive rail system until March 31.

Policemen beat a curfew violator in Mumbai, India, Wednesday, March 25, 2020. The world's largest democracy went under the world's biggest lockdown Wednesday, with India's 1.3 billion people ordered to stay home in a bid to stop the coronavirus pandemic from spreading and overwhelming its fragile health care system as it has done elsewhere. For most people, the new coronavirus causes mild or moderate symptoms, such as fever and cough that clear up in two to three weeks. For some, especially older adults and people with existing health problems, it can cause more severe illness, including pneumonia and death. (AP PhotoRafiq Maqbool)

Policemen beat a curfew violator in Mumbai, India, Wednesday, March 25, 2020. The world's largest democracy went under the world's biggest lockdown Wednesday, with India's 1.3 billion people ordered to stay home in a bid to stop the coronavirus pandemic from spreading and overwhelming its fragile health care system as it has done elsewhere. For most people, the new coronavirus causes mild or moderate symptoms, such as fever and cough that clear up in two to three weeks. For some, especially older adults and people with existing health problems, it can cause more severe illness, including pneumonia and death. (AP PhotoRafiq Maqbool)

Television images from many cities and towns on Wednesday showed shuttered markets and offices. Normally bustling railway stations stood empty. Joggers awkwardly navigated around each other while trying to maintain proper social distancing.

Police and security forces were deployed to keep people indoors, but allowed residents to buy essentials such as milk, bread and other groceries.

India has reported 519 confirmed cases of COVID-19, the disease cause by the coronavirus, and nine deaths.

A girl dressed in traditional attire to celebrate "Gudi Padwa", or the Marathi New Year, stands by a window and holds a placard with an acronym for the Coronavirus that reads in hindi "Nobody should come out on the roads," in Mumbai, India, Wednesday, March 25, 2020. The world's largest democracy went under the world's biggest lockdown Wednesday, with India's 1.3 billion people ordered to stay home in a bid to stop the coronavirus pandemic from spreading and overwhelming its fragile health care system as it has done elsewhere. For most people, the new coronavirus causes mild or moderate symptoms, such as fever and cough that clear up in two to three weeks. For some, especially older adults and people with existing health problems, it can cause more severe illness, including pneumonia and death. (AP PhotoRafiq Maqbool)

A girl dressed in traditional attire to celebrate "Gudi Padwa", or the Marathi New Year, stands by a window and holds a placard with an acronym for the Coronavirus that reads in hindi "Nobody should come out on the roads," in Mumbai, India, Wednesday, March 25, 2020. The world's largest democracy went under the world's biggest lockdown Wednesday, with India's 1.3 billion people ordered to stay home in a bid to stop the coronavirus pandemic from spreading and overwhelming its fragile health care system as it has done elsewhere. For most people, the new coronavirus causes mild or moderate symptoms, such as fever and cough that clear up in two to three weeks. For some, especially older adults and people with existing health problems, it can cause more severe illness, including pneumonia and death. (AP PhotoRafiq Maqbool)

As the day broke, major roads in India’s capital, usually jammed with traffic, were eerily quiet. The normal steady flow of pedestrians slowed to a trickle.

In Malviya Nagar, one of the capital's busiest neighborhoods, people lined up outside open grocery shops.

“Delhi looks like a ghost town,” said 29-year-old Nishank Gupta. “I have never seen the city so quiet before.”

A family, wearing face masks as a precaution from coronavirus, prays inside their house on the first day of Navratri festival, where Hindu fast for nine days, in New Delhi, India, Wednesday, March 25, 2020. The world's largest democracy went under the world's biggest lockdown Wednesday, with India's 1.3 billion people ordered to stay home in a bid to stop the coronavirus pandemic from spreading and overwhelming its fragile health care system as it has done elsewhere. For most people, the new coronavirus causes mild or moderate symptoms, such as fever and cough that clear up in two to three weeks. For some, especially older adults and people with existing health problems, it can cause more severe illness, including pneumonia and death. (AP PhotoManish Swarup)

A family, wearing face masks as a precaution from coronavirus, prays inside their house on the first day of Navratri festival, where Hindu fast for nine days, in New Delhi, India, Wednesday, March 25, 2020. The world's largest democracy went under the world's biggest lockdown Wednesday, with India's 1.3 billion people ordered to stay home in a bid to stop the coronavirus pandemic from spreading and overwhelming its fragile health care system as it has done elsewhere. For most people, the new coronavirus causes mild or moderate symptoms, such as fever and cough that clear up in two to three weeks. For some, especially older adults and people with existing health problems, it can cause more severe illness, including pneumonia and death. (AP PhotoManish Swarup)

At a pharmacy, Sushil Agarwal, an accountant, looked for a silver living.

“Surely, this is a time for introspection because people can realize what unpredictable things can happen to their lives. So maybe something good will come out of this,” he said.

On Tuesday, Modi said that to save India and every Indian, there would be a “total” ban on venturing out for three weeks. He acknowledged that the lockdown would be a major blow to the economy, but insisted that the alternative could be worse.

"If we are not able to manage the next 21 days, the country will be set back by 21 years," he said.

He pledged $2 billion to bolster the country's beleaguered health care system.

Wednesday is the start of the Hindu new year according to an ancient lunar calendar and the beginning of a nine-day holiday in which Hindus normally perform daily rituals at temples. The lockdown order, however, bans religious gatherings and instructs places of worship to close.

Modi acknowledged in a tweet that “The celebrations will not be like they are usually but they will strengthen our resolve to overcome our circumstances.”

“May we all come together to win the important battle that the nation faces against COVID-19,” he said.

Some Indians, including a member of Modi's Hindu nationalist Bharatiya Janata Party, defied the lockdown and attended temple ceremonies.

Yogi Adityanath, the chief minister of India's most populous state, Uttar Pradesh, prayed to a statue of Lord Ram at a makeshift temple in Ayodhya.

Meanwhile, medical personnel and airline crews are complaining that they face discrimination from landlords and neighbors who are afraid they might transmit the virus.

State-run carrier Air India issued a statement appealing “to all, particularly the law enforcement agencies to ensure that Air India crew are treated with respect and freedom that every citizen deserves, especially those who have been discharging their duties in selfless manner for return of fellow Indians.”

A health ministry statement on Tuesday said multiple complaints had been received from doctors, paramedics and other health workers in New Delhi that their landlords were forcing them to leave their houses or apartments.

The ministry asked police and municipal authorities to take strict action against the landlords.

Associated Press writers Rishabh R. Jain in New Delhi, Biswajeet Banerjee in Lucknow and Aijaz Hussain in Srinagar contributed to this report.