"In order to avoid a worst-case scenario and as an emergency precautionary measure, Japan will first of all ban the entry of foreigners into the country from midnight on Nov. 30," Prime Minister Fumio Kishida told reporters.
Japanese returnees from a number of specified nations would have to quarantine in designated facilities, he added.
The move marked a rapid escalation of restrictions since Friday when Japan said it would tighten border controls on people arriving from six African nations.
It comes just a few weeks after Kishida's administration eased quarantine measures on foreign business travellers to help boost the economy.
The World Health Organisation (WHO) warned that deciding the severity level of Omicron, identified first in South Africa, could take "days to several weeks" in the absence of information that its symptoms differed from those of other variants.
Japan has not detected any Omicron cases so far. One traveller from Namibia was found to be positive for the coronavirus, and further tests were being conducted to find out if it was from the new variant, Health Minister Shigeyuki Goto said in a separate press conference.
Nations around the world have enacted various border curbs since the WHO dubbed Omicron a "variant of concern." But until Kishida's announcement, Israel had been the only country to ban all foreigners.