Riyadh is pursuing sweeping labour reform that would tackle domestic unemployment by pushing firms to hire Saudi nationals - who now hold only about one in 10 private sector jobs - instead of some of its roughly 9 million foreign residents.
The disproportion of foreigners in jobs arises, some firms say, from the fact Saudis demand higher wages and are harder to sack than expatriates. Other firms, particularly those in fields involving manual labour, say they cannot attract Saudi workers.
Earlier this year the kingdom began to crack down on the many foreign workers who violated their visa terms with surprise inspections on streets and in company offices, followed in some cases by the deportation of offenders.
Saudi Arabia, whose total population is 28 million, has long turned a blind eye to the impact of its rigid foreign worker laws, resulting in a huge black market for expatriate labour.
On Tuesday, thousands queued in blazing sunshine outside the main passport office in Riyadh to secure exit visas, with many people saying they had waited in line for more than 24 hours.
"I just want to go back to Nepal because my salary is no good - only 600 riyals a month. I came here yesterday afternoon, slept on the ground and didn't eat anything. But when I got to the front of the line they said my papers were incorrect," said Dinesh Kumar Sar, 25, a labourer.
Local media quoted the spokesman for the Saudi passport office as saying 124,000 people had left the country since early April when the government announced a three-month grace period for illegal workers to rectify their status.
The economic impact of such a foreign exodus is not yet clear. Arab News said on Tuesday that roadworks in Riyadh had been delayed because of a foreign worker shortage. However, economists in the kingdom have previously said Saudi companies tend to overemploy due to the low cost of foreign labour.
The kingdom has large numbers of workers from India, Pakistan, Nepal, Sri Lanka, Bangladesh, the Philippines, Indonesia, Yemen, Ethiopia and other Arab states, many of which benefit from high levels of remittances.
Saudi law says expatriates must work for a designated Saudi sponsor in the professional field registered on their residency permit, or iqama.
Another common illegal practice is the so-called "free visa" system, under which a sponsor allows workers to find alternative employment but charges them a commission to renew their residence permit or seek an exit visa.
The Labour Ministry started cracking down on such practices after imposing rules last year to force companies to employ more Saudis, with fines and hiring restrictions imposed on firms that do not meet localisation quotas.
Local newspapers on Monday quoted the labour minister as saying the new rules had localised 600,000 jobs so far.
In early April King Abdullah announced a three-month grace period for workers to rectify their residence status by changing their sponsor or profession without facing the usual penalties.
That period will end on July 3, when the Labour Ministry has said it will renew the crackdown.
However, many have been unable to switch their sponsor to their current employer or to change their residence papers to show their current profession because doing so would put their company in breach of localisation rules.
Others have reported that their sponsor demanded large sums of money to transfer sponsorship.
"We don't have any law to punish sponsors who are asking for money or commission. What we can do is to just warn expats not to pay," Arab News quoted Labour Ministry spokesman Hattab al-Enizi as saying.
Many expatriates have just decided to return home. Officials have said if they leave within the grace period, they will be allowed to apply for another visa to work in the kingdom.
Get Breaking news, live coverage, and Latest News from India and around the world on NDTV.com. Catch all the Live TV action on NDTV 24x7 and NDTV India. Like us on Facebook or follow us on Twitter and Instagram for latest news and live news updates.