The blast in the Arar region followed a firefight between the border patrol and the assailants, one of whom was shot dead, a ministry spokesman said in a statement carried by the official SPA news agency.
"A border patrol in Suwayf, in the northern Arar region, came under fire by terrorist elements," the spokesman said.
As forces killed one of the assailants, another attacker "detonated an explosive belt he was carrying" killing himself and two guards and wounding another.
In July, three shells fired from inside Iraq hit the Arar area, without causing any casualties.
In November, Iraqi Shiite group Jaish al-Mukhtar claimed it had fired six mortar rounds into a remote area of northeastern Saudi Arabia as a "warning" to the kingdom.
Saudi Arabia shares a more than 800 kilometre border with Iraq.
The kingdom has been taking part in US-led air strikes against IS in Syria, in a move that has drawn threats of retaliation from the jihadists.
