Two suspected al Qaeda militants blew themselves up early on Saturday after being surrounded inside a government building in southern Saudi Arabia, following an attack on a border post with Yemen, Saudi-owned al-Arabia television reported.
The satellite channel, in a report on its website, quoted unnamed sources as saying the militants blew themselves up in the Sharurah area near the Wadia border post with Yemen.
The militants had put up "stiff resistance" to security forces surrounding them, firing automatic weapons and hurling grenades at security forces. There were no reports of casualties among Saudi security forces.
Saudi security forces had been searching buildings for militants who had fled after the attack, in which six people, including one suicide bomber and two security personnel, were killed.
Saudi Arabia, the world's biggest oil exporter, has long viewed its 1,800 km (1,100 mile) border with impoverished, conflict-ridden Yemen as a major security challenge and has been building a fence to deter militants and criminals. Gunmen on Friday killed the commander of a border patrol on the Saudi side of the Wadia border post, where three of the attackers also died in an ensuing firefight, Saudi state news agency SPA said.
The agency said security forces had arrested one of the gunmen and were searching for one or two others believed to be hiding in the area.
Yemen's state agency Saba earlier reported that a suicide bomber drove a car laden with explosives into the Yemeni side of the Wadia border crossing, killing himself and one soldier and wounding another.
After the attack, Yemeni security forces chased militants who fled from the scene in two cars into the desert, Saba said, citing a military source.
But a Yemeni official, apparently referring to the same incident, earlier told Reuters the gunmen had escaped into Saudi Arabia after attacking the Yemeni border post. The official said the attackers were al Qaeda militants.
The Wadia crossing links Saudi Arabia with Yemen's southeastern Hadramout province, which stretches through arid valleys and empty desert - a landscape that al Qaeda militants use to their advantage across the Middle East.
Saudi Arabia's construction of the security fence along its border with Yemen has often been interrupted by protesting tribesmen who say it prevents them accessing pastures for their livestock. The kingdom overcame its own al Qaeda insurgency almost a decade ago, but said in May it had detained 62 suspected al Qaeda militants with links to radicals in Syria and Yemen who it said it believed were plotting attacks on government and foreign targets in the kingdom.