Photo/Illutration The departure lobby at Terminal 3 of Tokyo's Haneda Airport is mostly deserted on March 19 as many international flights were canceled due to the outbreak of the new coronavirus. (Asahi Shimbun file photo)

The Japanese government raised its global travel alert on March 25 to Level 2 for the first time and urged the public not to travel abroad unless absolutely necessary.

People who leave Japan risk not being able to return to the country, the Foreign Ministry warned.

The ministry said it ramped up the level on the government's four-tier travel alert scale to prevent travelers from becoming stranded in countries they are visiting.

Japan also raised its infectious disease warning for Ireland, Portugal and Sweden to Level 3 the same day, the Foreign Ministry said.

The government issues the travel alerts based on the overall security and political situations in countries to inform citizens of safety measures they need to take while traveling there.

Countries around the globe have closed their borders and imposed curfews in efforts to contain the spread of the coronavirus.

An increasing number of travelers from Japan have become stuck overseas as airlines have suspended and reduced the number of their flights, the Foreign Ministry said.

The government issued a Level 1 infectious disease warning for the entire world on March 18, calling on people to exercise extra caution if traveling outside Japan.

It raised the warning to Level 3 for China, South Korea, Iran and 18 European countries, including Italy, Spain and Germany.