More than one million people in Sydney's central and eastern suburbs, including Bondi Beach, will be locked down after a jump in Covid cases.
The Australian city is battling to contain an outbreak of the highly infectious Delta variant.
Officials reported 17 new cases on Friday, taking the cluster to 65 cases.
It is the first lockdown in Australia's largest city since December. The country has consistently maintained very low rates of Covid transmission.
The stay-at-home order will affect the city centre and inner-city suburbs, as well as beachside suburbs in the east.
"We don't want to see this situation linger for weeks. We would like to see this situation end sooner rather than later," New South Wales Premier Gladys Berejiklian said.
But she added that medical experts believed only a targeted lockdown was necessary for now, sparing the wider city from shutting down.
From Saturday, residents as well as people who work in the affected areas will have to stay at home except for essential reasons. The lockdown will be enforced until 2 July.
Residents in the virus hotspots had already been banned from travelling out of the city. Other Australian states and territories have also blocked arrivals from Sydney.
Sydney's current outbreak marks its most significant rise in Covid transmission since December. For most of the year, locals had enjoyed almost no restrictions on daily life.
The cluster of infections emerged just a week ago in Bondi, the famous beach suburb, but has since spread into the city centre and to its western fringes.
It has been linked to a driver who transported international arrivals from the airport.
Ms Berejiklian stressed that the stay-at-home order would also apply to workers, noting that office workers commuting to and from the central business district had brought the virus into outer suburbs.
About half a million people work in Sydney's central financial district, generating about a third of the city's economy.
Lockdown highlights vaccine delay
Australia has enacted strict border closure and quarantine measures since March 2020 to keep the virus out of the country.
However, very infectious strains of the virus - such as the Delta and Alpha variants - have increasingly breached the defences of the quarantine system, which is largely run out of hotels in state capitals.
Since November, more than eight lockdowns have occurred in various state capitals across Australia including Melbourne, Brisbane, Perth and Adelaide due to leaks from quarantine hotels.
Melbourne only last week emerged from a two-week lockdown to counter a Delta outbreak. Prime Minister Scott Morrison committed to plans on Friday for purpose-built quarantine centres, which critics said should have been built earlier.
Sydney's outbreak has also fuelled criticism over the federal government's slow vaccination rollout. Vaccine hesitancy has also been a problem.
Local media reported the driver at the centre of Sydney's outbreak had been reluctant to take the AstraZeneca vaccine due to its rare blood-clotting risk.
So far, just over 3% of the adult population has been fully vaccinated and about 25% of Australians have received a first dose. Government critics, including political opposition, have argued that cities would not need to endure lockdowns again if a majority of the population was vaccinated.
Sydney has seen outbreaks before but authorities have steered away from citywide lockdowns. Instead it has relied on its swift contact-tracing system and setting restrictions on targeted areas.
In December, officials locked down the city's northern beaches district to contain a cluster of about 150 cases.