Saudi Arabia has launched an online service to assist non-nationals wishing to return to their home countries.
The country took the unprecedented step of sealing all its ports of entry and exit to everyone in early March.
The move, which has been replicated by other countries around the world, left dozens of people stranded in and out of the kingdom.
Those requesting to leave Saudi Arabia will have to submit their application through an online service called Awdah, meaning "return".
It is found in the "Abshar" online program, the Ministry of Interior said late on Wednesday.
All requests will be reviewed by the relevant authorities.
Residents with valid visas must upload their personal details, including their location to help authorities contact them.
They will be sent flight details when they are arranged, the ministry said.
Flights will leave from airports in the capital Riyadh, Jeddah, Madinah and Dammam.
The ministry said it would allow people wishing to leave the country and who live in other cities to travel to the designated airports.
Thus far, the lockdown has stopped the public travelling between cities.
Saudi Arabia suspended travel for its citizens and residents amid coronavirus fears.
It also suspended the entry of people from countries with a high number of infections or anyone who has been there since the start of March.
The kingdom has 12,772 infected cases and 114 deaths.
More than 172 people have recovered in the last 24 hours, raising the number of recoveries to 1,812, the health ministry said.
Saudi authorities have reported daily case increases of more than 1,000 since Friday, despite issuing strict guidelines to control the spread of infection.