expatriates whose remittances home provide important revenue for countries including Yemen, India, Pakistan and the Philippines.
"King Abdullah directed both the interior ministry and the labour ministry to give an opportunity to workers in breach of the labour and residency regulations in the kingdom to clarify their status in a period not exceeding three months," said a statement carried on official media.
More than 200,000 foreigners have been deported from the country over the past few months, a passports department official said in comments reported by al-Hayat daily this week.
The crackdown is part of labour market reforms aimed at putting more Saudi nationals into private sector jobs, where they now make up only a tenth of the workforce.
The most recent central bank statistics, for 2011, showed nine in 10 working Saudis were employed by the public sector.
The Middle East's largest economy grew by 6.8% last year, but regards low employment among nationals as a long-term strategic challenge, a view given added impetus after joblessness in nearby countries contributed to revolutions.
"The labour ministry does inspections inside the enterprises to make sure there are no violations to the labour system ... We will continue our work to make sure labour system regulations are applied," labour ministry spokesman Hattab al-Enazi told Reuters on Saturday before the king's announcement.
Under Saudi law, expatriates have to be sponsored by their employer, but many switch jobs without transferring their residency papers.
That has allowed companies to dodge strict labour ministry quotas regulating the number of Saudis and expatriates each firm can employ by booking their foreign workers under a different sponsor. Companies with too few Saudi employees face fines.
It has also led to the emergence of a labour black market in which sponsors illegally charge expatriates to renew their residence documents when they in fact work for somebody else.
Some businesses in the past week have reported difficulties operating as expatriate workers stayed at home to avoid inspectors coming to check their residence permits.
Parents of children at two private schools in Riyadh said there had been unscheduled holidays for the past week as teachers stayed at home for fear inspectors would discover their residence papers were incorrect.
"Now my kids can resume studies as normal," said the mother of three children at one of the schools.
On Monday Yemen expressed concern at the rapid pace of deportations of its workers, who provide around $2 billion in remittances a year to Saudi Arabia's impoverished neighbour.
In India, Oommen Chandy the chief minister of Kerala, home to a large number of expatriates based in Saudi Arabia, wrote to Prime Minister Manmohan Singh asking him to intervene, Press Trust of India reported on Friday.
The most recent annual report from Saudi Arabia's central bank said remittances from the country in 2011 grew by 5.4% from 2010 to 103.5 billion riyals, or 17.4% of its current account surplus.
"When I heard of the inspection campaigns I was very depressed. I am the only source of income to my family and in light of the current situation in Egypt, I thought if I went back I would find no real job," said Abo Hassan, who did not give his full name.
He said he pays his sponsor 1,500 riyals a year while working privately as a driver.
Last month the labour ministry said extensive reforms adopted over the past year have put more than 600,000 Saudi citizens into private sector jobs.