India has mounted the largest attempted lockdown yet in the coronavirus crisis, ordering 1.3 billion people to stay at home from midnight for three weeks to prevent a public health disaster.

In a televised address on Tuesday night, the prime minister, Narendra Modi, announced that for the next 21 days, almost one fifth of the world’s population should “forget what going out means”.

“From 12 midnight today, the entire country will go under a complete lockdown to save India and for every Indian, there will be a total ban on venturing out of your homes,” said Modi. “Therefore, I request you to remain wherever you are in this country.”

India suspends domestic flights as coronavirus spreads Read more

He later tweeted that “essential commodities, medicines etc” would be available, although he did not explain if Indians would still be allowed to leave their homes to shop for essentials. “THERE IS ABSOLUTELY NO NEED TO PANIC,” he wrote.

So far India has had a relatively low number of coronavirus cases, with 469 infections and 10 deaths so far, and the government had already introduced stringent measures to try to halt local transmission in a country where millions live in densely populated conditions with terrible sanitation and limited healthcare access.

There are currently only 40,000 ventilators in India, one isolation bed per 84,000 people and one doctor per 11,600 Indians. More than 1.8 million people across the country are being monitored because they have shown symptoms of the illness, travelled from abroad or been exposed to confirmed cases.

It is feared that the low infection figures are linked to a lack of testing, with only around 17,000 tests carried out so far. The virus has now spread to almost all states in India, with the highest number of cases in Maharashtra, where the city of Mumbai is located, and the southern state of Kerala. There are 41 foreigners among the infected.

In his speech, Modi said that the government and experts had spent the past two months studying coronavirus outbreaks in other countries and had concluded that forcible social distancing via a lockdown was the only solution to prevent it taking hold in India.

He added: “If we are not able to manage this pandemic in the next 21 days, the country and your family will be set back by 21 years. If we are not able to manage the next 21 days, then many families will be destroyed forever.”

Facebook Twitter Pinterest People buying groceries following Narendra Modi’s announcement of a lockdown. Photograph: Indranil Mukherjee/AFP via Getty Images

The announcement prompted panic buying across the country, with many thousands rushing out to get supplies and queues forming outside grocery shops, as Modi did not specify whether people would be allowed out for food shopping, though he later clarified this in a tweet.

The announcement is likely to have a devastating impact on the 300 million Indians who live below the poverty line and survive hand to mouth based on daily earnings. Indian finance minister Nirmala Sitharaman has promised a comprehensive relief package will be announced soon.

Play Video Coronavirus: 'each and every individual matters', says WHO director – video

In Delhi, which has been under lockdown since Sunday, with state borders closed, taxis and rickshaws cleared from the roads, all but essential travel banned and shops and restaurants shut, the chief minister, Arvind Kejriwal, set up shelters across the city where people could come for free meals.

The lockdown measures brought in by Modi were in line with what experts have recommended as necessary for India, though it remains unclear how they will be enforced in a democracy of more than a billion people.

Rupam Bhattacharya, a member of the Cov-Ind-19 study group of researchers at the University of Michigan that’s looking specifically into the coronavirus outbreak in India, said: “This pandemic is growing quick, and the only way we can cope with it is by keeping up with its pace by bringing rapid and strict precautionary measures into action.”

He added: “If too many people get affected at the same time, it creates an immense pressure on the healthcare system, which will be even more pressing on the high-population, low-resource infrastructure that India has, and may lead to an eventual collapse.”

Shaikh Azizur Rahman contributed reporting