When Australia threatened to imprison citizens who breached a ban on returning from India during a severe coronavirus wave, it justified the measure by saying it wanted to keep the public safe.

But the travel ban — which carries criminal penalties of up to five years in jail — has sparked a backlash from civil rights advocates, the Indian diaspora and the cricketing community with claims it is racist, illegal and cruel.

“It’s a disgrace!! Blood on your hands PM,” Michael Slater, a former Australian cricketer and commentator covering the Indian Premier League, wrote on Twitter, referring to Scott Morrison.

The government fired backed, calling Slater “a spoilt prat” and suggesting he should take personal responsibility for travelling to India to work at the lucrative tournament during a pandemic. Canberra also denied its hardline border security policy was racist or designed to win votes.

But the controversy has reignited a debate about the government’s responsibility to thousands of citizens stranded overseas as a result of strict flight caps and travel bans to keep Covid-19 out of Australia.

It has also highlighted how Australia, previously a global leader in handling the pandemic, has struggled to reopen to the world because of a botched vaccine rollout and leaky hotel quarantine system.

About 9,000 Australian citizens want to return home from India, which on Thursday recorded a world record 414,182 Covid-19 cases. Tens of thousands of Australians remain stranded in other countries.

Morrison, the prime minister, said he had to make difficult decisions to ensure a third wave of infections did not reach Australia, a country that has almost eliminated the community spread of coronavirus, with few cases recorded outside hotel quarantine.

“The likelihood of any of that [jail or fines] occurring is pretty much zero,” he said as criticism mounted over the two-week ban, which is scheduled to remain in place until May 15.

Australia’s federal and state governments had earned global praise for tough measures to suppress Covid-19, including shutting its international borders early in the crisis.

But critics said the government had left the country vulnerable to outbreaks of Covid-19 by vaccinating fewer than one in 10 people and resisting calls by opposition parties and health experts to build specialised quarantine centres.

“They just got cocky and confident and thought they didn’t need to do anything else because everyone was enjoying going to the beach,” said Andrew Miller, president of the Australian Medical Association in Western Australia.

Miller said data showing that one in every 110 positive cases in hotel quarantine resulted in a leak and community spread had panicked Canberra into imposing the Indian travel ban, fearing further outbreaks.

This week, the government said it was considering using a former mining camp in the remote Northern Territory to repatriate Australians from India after the ban had lifted. It was also discussing a proposal by the Victoria state government for a separate, purpose-built quarantine centre.

But it was the threats of criminal charges attached to the travel ban that have infuriated many Australians. Opponents alleged the penalties were unique in the developed world and possibly illegal.

Indian community leaders argued that Australian citizens of Indian descent were being made to feel like second class citizens. “People are feeling it’s racist,” said Jagvinder Singh Virk, chair of the India Australia Strategic Alliance. He told Australian media the strictures amounted to the White Australia policy, which aimed to prevent migration by non-Europeans for much of the 20th century, running “under the radar”.

In India, a 73-year-old Melbourne man stranded in Bangalore has challenged whether the orders made under Australia’s Biosecurity Act were in violation of the constitution, in a case due to be heard from Monday.

The restrictions have also provoked criticism from backbench MPs and even conservative columnists in The Australian newspaper, a staunch supporter of the Morrison government.

“It was heartless and while opinions may differ on the legality of the government’s action, the fact is they are immoral and cowardly because of the prime minister’s critical failures to shoulder difficult tasks,” wrote Niki Savva, a columnist.

Savva added that the measures smacked of an old-fashioned political calculation of where the most votes could be won or lost.

Closing state and international borders to prevent the spread of the virus has become a popular strategy during the pandemic, according to polling experts.

“The travel ban will be opposed by relatively small groups of people, such as newly arrived immigrants,” Ian McAllister, professor of politics at Australian National University. “However, the loss of their support will be much less than the support they will attract for the measures from the broader public.”