The exodus of thousands of scared and starving migrant workers from India’s major cities is becoming a “bigger problem” than the coronavirus outbreak itself, the country’s supreme court has warned.

With construction sites, offices and factories closed to contain the spread of Covid-19, those who have historically flocked to India’s metropolises looking for unskilled work are now fleeing en masse.

The suspension of all public transport means they are attempting to make the journey back to their villages on foot - hundreds of miles in many cases, and in soaring temperatures as summer approaches.

At least 22 have now died on the road, and images of the crowds making their way along deserted highways with bags held over their heads have sparked outrage and dominated the headlines of many national newspapers on Monday.

On Sunday, police opened fire with tear gas on a group of around 500 workers who protested their treatment outside a closed factory in the western city of Surat. And when a small number of buses were provided by the government of Uttar Pradesh state, videos on social media showed vast crowds swelling at bus shelters in spite of clear orders about social distancing.

Activists and opposition parties say the exodus is the result of poor planning by the government and should have been predicted. Announcing the national lockdown last Tuesday night, prime minister Narendra Modi gave citizens just four hours’ notice before the stay-at-home orders came into effect.

Sitting on Monday via video conference, Chief Justice of India S A Bobde and his supreme court colleague Justice L Nageswara Rao heard two petitions from lawyers seeking food, medicine and proper medical facilities for the migrant workers left stranded by the coronavirus crisis.

The judges said the migrants were motivated to flee cities by panic at the lockdown. “This fear and panic is a bigger problem than this virus,” they observed.

They ordered the Modi administration to file a report to the court, explaining what actions it was taking to alleviate the migrants’ plight, and said they would wait to hear back before passing judgement. “We are not going to add to the confusion by issuing directions which are already being taken care of by the government,” they said, according to the Indian Express.

India has now confirmed more than 1,000 coronavirus cases and at least 29 deaths, 18 days after it first banned all tourism to the country in a clampdown on international travel that was seen as a stringent measure at the time.

With cases still rising even after a complete ban on all international flights, on Sunday the health ministry quietly admitted that “limited community transmission” of the virus within India was now taking place.

In an update on Monday, the Indian Council of Medical Research, said the country had conducted 38,442 tests for the virus so far, among a population of nearly 1.4 billion people. The research body said it was still operating at “less than 30 per cent of our testing capacity”.

Addressing the migrant worker exodus, the central government ordered states to seal their borders and to put under 14-day mandatory quarantine all those trying to return to their villages.

In a bid to prevent others setting out, the government said states should “ensure timely payment of wages to labourers at their place of work” and that landlords do not charge rent to daily-wage labourers during the lockdown.

Such measures to reassure workers were welcomed, but critics questioned why they only came five days after the national lockdown was ordered. Some compared the move to Mr Modi’s decision in 2016 to withdraw all large-denomination banknotes overnight, which led to weeks of chaos at ATMs and left a serious dent on the economy.

Prashant Bhushan, a leading public interest lawyer and activist, said the spreading of thousands of people from cities with infections to remote villages, many of which have extremely limited healthcare facilities, “completely destroys the object of the lockdown” as well as the workers’ own “lives and livelihoods”.

Coronavirus culture from rooftops, windows and balconies Show all 15 1 /15 Coronavirus culture from rooftops, windows and balconies Coronavirus culture from rooftops, windows and balconies A rose is delivered by drone to a woman on Mother's Day in Jounieh, Lebanon AFP/Getty Coronavirus culture from rooftops, windows and balconies Women dance on their balcony as a radio station plays music for a flash mob to raise spirits in Rome Reuters Coronavirus culture from rooftops, windows and balconies A skeleton stands on a balcony in Frankfurt, Germany AP Coronavirus culture from rooftops, windows and balconies The film Le ragazze di Piazza di Spagna is projected on a building in Rome AP Coronavirus culture from rooftops, windows and balconies A woman uses a basket tied to a rope to pull a delivery of groceries up to her balcony in Naples, Italy EPA Coronavirus culture from rooftops, windows and balconies DJ Francesco Cellini plays for his neighbours from the rooftop terrace of his flat block in Rome Reuters Coronavirus culture from rooftops, windows and balconies A woman gestures from her balcony in Barcelona EPA Coronavirus culture from rooftops, windows and balconies Cellist Karina Nunez performs for her neighbours at the balcony of her flat in Panama City Reuters Coronavirus culture from rooftops, windows and balconies DJ Nash Petrovic live streams a set from his roof in Brooklyn Reuters Coronavirus culture from rooftops, windows and balconies People applaud medical workers from their balconies in Modiin, Israel Reuters Coronavirus culture from rooftops, windows and balconies A Brooklyn resident relaxes in a hammock hung on their balcony Reuters Coronavirus culture from rooftops, windows and balconies Residents toast during a "safe distance" aperitif time between neighbours in Anderlecht, Belgium Reuters Coronavirus culture from rooftops, windows and balconies Musician Adam Moser plays for neighbours from his balcony in Budapest, Hungary Reuters Coronavirus culture from rooftops, windows and balconies A man and his son on their balcony in Brooklyn Reuters Coronavirus culture from rooftops, windows and balconies A man sits alone on a roof terrace in Rome Reuters

“The PM himself is responsible for the death of these [22] migrants,” he wrote on Twitter. “Like [the 2016] note ban, he ordered this lockdown without consulting experts or thinking through the consequences.”

A spokesperson for the opposition Congress party said “unilateral” decisions by the Modi administration “have rendered havoc in the country time and again. Yet the government does not plan, think or even consult anyone. It's no surprise our crisis has increased manyfold due to the government's ineptitude.”

Even before Sunday’s orders from the central government, a number of states had already begun setting up food distribution centres and shelters for stranded and jobless workers.

Delhi’s government said on Friday that 200,000 people were given food at more than 300 schools, political headquarters and existing homeless shelters requisitioned for that purpose. Deputy chief minister Manish Sisodia said the number of centres was scaled up to more than 560 at the weekend and others were fed directly by “flying squads” of volunteers, police and officials.

But not everyone is waiting around for state aid to catch up to demand. Speaking to the journalist Barkha Dutt as he embarked on a 250km walk from Delhi to Bareilly in Uttar Pradesh, labourer Rajneesh asked: “Have we been left like this because we are poor? No neta (politician) or their relatives will die, it is only the poor who will die. Poverty and walking like this will kill us before the virus will.”

Ram Bhajan Nisar, a worker from a village near the border with Nepal in Uttar Pradesh who was working in Delhi as a painter, told the Associated Press he set off from the capital last week with his wife and two children.

“I walked two days, two nights to reach here, and both the children have blisters on their feet,” said Nisar, who was then sent for quarantine in a government school.

Mr Modi did apologise on Sunday for the chaos his lockdown had caused, saying in a nationwide radio address that he had had “no choice”. “I would firstly like to seek forgiveness from all my countrymen,” he said. “The poor "would definitely be thinking what kind of prime minister is this, who has put us into so much trouble," he said, urging them to remember that “the steps taken so far will give India victory over corona”.

Such addresses are some of the only times Indians hear from their prime minister, who has never given a press conference on any subject since he first came to power in 2014.