DUBAI - Gunmen killed the commander of a Saudi border patrol on the frontier with Yemen on Friday and security forces shot dead three of the attackers in the ensuing firefight, the Saudi state news agency SPA said.

SPA, citing Saudi Interior Ministry spokesman Major General Mansour al-Turki, said the attack had occurred at the Wadia border crossing but did not say who was behind the shootings.

Security forces arrested one of the gunmen and were searching for one or two others believed to be hiding in nearby buildings, SPA reported. A Yemeni official, commenting on what appeared to be the same group of gunmen, told Reuters suspected al Qaeda militants in two cars had opened fire on Yemeni border guards at the Wadia crossing on Friday before crossing over to the Saudi side.

They killed one Yemeni soldier, the official added. The Wadia crossing is in the southeastern Yemeni province of Hadramout, which stretches from the port of Mukalla in the south to the Saudi border, through arid valleys and empty desert, landscape that al Qaeda militants use to their advantage across the Middle East.

Saudi Arabia views its 1,800 km (1,100 mile) border with impoverished, conflict-ridden Yemen as a major security challenge. It has been building a security fence since 2003, though work has often been interrupted by protesting tribesmen who say it prevents them accessing pastures for their livestock.

The kingdom, the world’s top oil exporter and ally of the United States, overcame its own al Qaeda insurgency almost a decade ago but it has watched with alarm the recent military advances by radical Sunni Islamists in neighbouring Iraq. In May, Riyadh said it had detained 62 suspected al Qaeda militants with links to radicals in Syria and Yemen who were plotting attacks on government and foreign targets in the kingdom.