Hundreds of thousands of people across Melbourne's north and west were ordered to stay at home Tuesday as Australia's second-biggest city struggled to contain a spike in coronavirus cases.

The southern state of Victoria has recorded 233 COVID-19 cases since Thursday -- mostly in Melbourne -- a major surge in a country that has otherwise successfully curbed the spread of the virus.

State premier Daniel Andrews said more than 30 Melbourne neighbourhoods would be subject to the lockdown from midnight local time Wednesday until July 29.

The areas covered are home to more than 300,000 people, in the city of roughly five million.

Residents will be allowed to leave their homes only for work or school, to exercise, or to buy food and other essential items.

People from other areas will be prevented from entering the worst-affected communities, with police on patrol and officers stopping cars to conduct random checks.

Many businesses will have to close down just weeks after reopening.

"These are extraordinary steps," Andrews said.

"But such is the nature of this virus, it is so wildly infectious that if we don't take these steps now we will finish up in a situation that rather than locking down ten postcodes we will be locking down every postcode," he added.

"I don't want to get to that point."

People in Melbourne will be allowed to leave their homes only for work or school, to exercise, or to buy food and other essential items People in Melbourne will be allowed to leave their homes only for work or school, to exercise, or to buy food and other essential items Photo: AFP / Allan LEE

Andrews said he had asked Prime Minister Scott Morrison to divert international flights bound for Melbourne to other cities in Australia in a further effort to control the spread of the virus.

Genomic sequencing showed that a "significant number" of the new cases were linked to staff breaching infection-control protocols in hotels that are being used to quarantine Australians returning from overseas, Andrews added.

Hundreds of health workers and military personnel have been drafted from around the country to assist with the efforts to curb the virus.

Officials have been door-knocking in the worst-affected communities, urging residents to get tested for COVID-19.

Australia has recorded about 7,800 coronavirus cases and 104 deaths in a population of 25 million.

Several Australian regions are believed to be effectively virus-free, allowing states to continue rolling back restrictions first introduced in late March.

Victoria, which had curbed the virus through early restrictions on travel and gatherings, had been easing rules until the flare-up last week.

That prompted neighbouring South Australia state on Tuesday to postpone plans to open its border to Victorians.

Queensland announced Tuesday it would reopen its borders from July 10 to all Australians, except those who had visited Victoria within the past 14 days.

New South Wales has warned residents against visiting the virus "hot spots".