Militants killed two Saudi border guards and their commanding officer on the frontier with Iraq early on Monday, the interior ministry said, in a suicide and gun attack one analyst called ISIL's first assault on the kingdom.
The boundary, defended by earth barriers and fences and monitored by cameras and radar, has been attacked in the past by mortar bombs fired from a distance, but there have been no ground assaults in recent years.
No group immediately claimed responsibility for the assault, which hit a remote desert area next to Iraq's Anbar province where both the ISIL militant group and Shi'ite Muslim militias close to Riyadh's foe Iran operate.
The use of a suicide bomber pointed to ISIL, said Mustafa Alani, an Iraqi security analyst with close ties to Saudi Arabia's interior ministry.
"It is the first attack by ISIL itself against Saudi Arabia and is a clear message after Saudi Arabia entered the international coalition against it," he said.
Saudi forces have joined US-led air strikes against ISIL positions in Syria.
The Sunni Islamist movement, which has declared its own caliphate and wants to redraw the map of the Middle East, has called for "lone-wolf" attacks against Saudi security forces, the Shi'ite Muslim minority and foreigners.
ISIL sees Saudi Arabia's links to the West as a betrayal of Islam. Riyadh, which sees itself as a champion of Sunni Islam, has mobilised conservative Sunni clergy to describe the ideology of the Al Qaeda offshoot as "deviant" and they condemned the attack in a statement later on Monday.
The Interior Ministry said it would not know which group was responsible until it had identified the remains of the attackers, a process it said would take some time.
However it described them as "kharijites", members of an early Islamic sect seen by most modern Muslims as extremist, and which senior Saudis have previously compared to ISIL.
The four raiders carried assault rifles, handguns, hand grenades and bank notes, the ministry said in a statement on state media.
They shot at a border patrol near Arar and when security officers responded, one of the attackers was captured and detonated an explosives belt, the ministry added.
One of those killed was General Oudah Al Belawi, the senior border guard in Northern Borders province, which covers most of Saudi Arabia's frontier with Iraq.
The attacker who detonated the explosives was killed, as was another attacker who was shot during an initial exchange of fire at 4.30am near the Suweif border post, the statement said.
Two other militants were later killed trying to escape, ministry spokesman Major General Mansour Turki told Reuters.
Saudi Arabia boosted its security on the frontier in July, adding thousands of troops to back up a border guards force, after ISIL seized swathes of territory in Iraq including in Anbar province.
The Suweif border post, which Reuters visited in July and is only open to traffic during the annual haj pilgrimage, is 40 km (25 miles) from the Saudi city of Arar and 80 km from the Iraqi city of Al Nukhayb, which is held by the government.
Riyadh said last month that the killing of eight Shi'ites in Al Ahsa province was carried out by gunmen linked to ISIL, and that supporters of the group were also behind the shooting of a Danish citizen in November who survived.For all the latest business news from the UAE and Gulf countries, follow us on Twitter and Linkedin, like us on Facebook and subscribe to our YouTube page, which is updated daily.
Subscribe to Arabian Business' newsletter to receive the latest breaking news and business stories in Dubai,the UAE and the GCC straight to your inbox.