One woman was killed in a stampede and part of the Indonesian consulate in Saudi Arabia set on fire during a riot by a group of 12,000 workers who had been waiting for hours to confirm their residency status.
The crowd of Indonesians gathered outside the consulate in Jeddah on Sunday, trying to sort out their papers in the face of a July crackdown by Saudi authorities on illegal immigrants.
Videos posted online and verified by witnesses showed a fire against the wall of the consulate. Other pictures showed men with scarves over their faces setting alight plastic barriers next to the wall.
Before the fire, rocks and stones were thrown at the consulate by the workers frustrated by long waits to get their cases dealt with.
The Indonesian Ministry of Foreign Affairs on Monday confirmed that a national had died during the disturbance.
The ministry told Al Jazeera that the consulate was actually well prepared, and the people "just had to wait in line". It blamed provocative actions by some people as the cause of the riot.
"The ministry also said that someone was spreading rumours before the riot that Sunday was the last day to get this document and that was the main cause for all the unrest," Al Jazeera's Step Vaessen, reporting from Jakarta, said.
About 180,000 illegal foreign workers have left Saudi Arabia since April 1 under an amnesty that allows them to try to sort out their papers or leave without paying a penalty, a newspaper report said on Sunday.
This brings the number of foreign workers who have left Saudi Arabia since the beginning of the year to 380,000.
Asem al-Ghamdi, a journalist based in Jeddah, told Al Jazeera that there was heavy security outside the Indonesian council early on Monday.
He added that the workers had gathered out of fear of losing their jobs and having to leave the country, and that some observers said that the Saudi government must extend the grace period.
Workers without proper papers are becoming increasingly concerned as violators of the immigration rules in the country will face penalties when the amnesty period ends on July 3, with punishment including imprisonment of up to two years, and fines of up to $27,000.