Japan enacted a time-limited legal change on Friday, enabling Prime Minister Shinzo Abe, if he deems it necessary, to declare a state of emergency to cope with the spread of the new coronavirus.

After only three days of deliberations, parliament gave such authority to Abe, who has for weeks come under fire for being slow to act to contain COVID-19, the illness caused by the virus, with just over four months until the start of the Tokyo Olympics.

The swift reworking of the legal framework is intended to prepare for a worst-case scenario but has still raised concerns that bolder preventive steps, once a state of emergency is declared, could infringe upon people's rights.

"It's important to carefully make a judgment based on various expert opinions given the grave impact (a declaration) would have on people's everyday life," Chief Cabinet Secretary Yoshihide Suga said at a press conference.

"At this point, we are not in a situation in which a state of emergency needs to be declared immediately," the top government spokesman said.

The House of Councillors passed the bill with the backing of the ruling coalition and major opposition parties on Friday, a day after it cleared the more powerful House of Representatives.

The aim of the law change is effective for two years. Abe has said the country is at an "extremely important" time to prevent the pneumonia-causing virus from spreading rapidly.

(Students wearing masks attend their graduation ceremony at a junior high school in Osaka on March 13, 2020. The ceremony was shortened and attendance was limited due to the spread of the new coronavirus.)

The government sought to revise the law on new types of influenza and infectious diseases that came into force in 2013, saying the new coronavirus is not covered as is.

Major opposition parties argue that the current law will do, but eventually agreed to back the revision to ramp up containment measures, at a time when the World Health Organization has described the outbreak as a "pandemic."

The prime minister can now declare a state of emergency for specific areas for a limited period of time when coronavirus infections spread rapidly across the country and raise fears of a grave impact on people's lives and the economy.

Once a declaration is made, prefectural governors can demand that residents stay indoors and ask for school closures as well as event cancelations.

Gist of Japan's revised law to deal with coronavirus spread

-- COVID-19 added to law on new types of influenza.

-- Revised law is effective for 2 years.

-- State of emergency to be declared if infections spread rapidly and significantly affect people's lives.

-- Governors can ask people to stay indoors under state of emergency.

-- Local governments can demand essential supplies such as medicine and food.

-- Local governments can take over private land and facilities to provide medical care.

-- They can expropriate such property if refused for no legitimate reasons.

Local governments can also demand that essential supplies such as medicine and food be sold to them, and temporarily take over private land and facilities to provide medical care. If refused for no legitimate reasons, they are allowed to expropriate such property.

In decisions that caught many by surprise in late February, Abe requested that all schools shut until a spring break ends in early April, asking organizers to cancel, postpone or scale down big sports and cultural events.

Abe made those requests to reduce group transmission risks but without having the legal basis for enforcing them.

Both ruling and opposition party lawmakers say the government should be cautious about declaring a state of emergency that would suppress people's rights and freedom.

The passage of the bill through the lower house on Thursday came with a resolution calling on the government to notify parliament beforehand in principle.

Japan has seen clusters of infections appearing in parts of the country, but it has prevented what a government panel of medical experts has described as an "explosion" of cases.

The number of domestic cases has topped 1,400, with about 700 from the Diamond Princess cruise ship that was quarantined near Tokyo in February. The death toll stands at 28.

On Monday, Japan started asking all travelers from China and South Korea, regardless of nationality, to stay in designated facilities such as hotels for 14 days. It has also invalidated nearly 3 million visas already issued to Chinese and South Koreans as part of temporary steps until the end of March.