A blast triggered by a suicide bomber has killed 15 people at a mosque inside a special forces headquarters in Saudi Arabia near the border with Yemen.

An interior ministry spokesman said on Thursday that the "terrorist" attack took place during noon prayers in the city of Abha, in the southern province of Asir.

Twelve of those killed were members of a Special Weapons and Tactics (SWAT) unit, while the other three were workers at the compound, officials said.

Islamic State of Iraq and the Levant (ISIL) has claimed responsibility for the attack that also left nine others wounded.

Earlier, state media said 17 people were killed.

Saudi Television said initial information indicated that the blast occurred after a suicide bomber detonated his explosive belt.

Earlier speaking to Al Jazeera, a Saudi political analyst said that if the latest attack is proven to be the handiwork of ISIL groups, it would be the largest ISIL attack targeting security forces inside the oil-rich kingdom. 

"Those guys, they are at war with us," Jamal Khashoggi told Al Jazeera. "This is shaking us to the ground."

Inside Story: How is ISIL expanding?

Thursday's bombing was the most serious in recent months against Saudi security forces, who have been targeted in attacks blamed on the ISIL group.

In mid-July, a car bomb exploded at a security checkpoint near a prison in the capital Riyadh. It killed the 19-year-old driver and wounded two policemen, the interior ministry said.

In the southwestern city of Taif on July 3, a policeman was gunned down during a raid in which three people were arrested and flags of the ISIL group found, police said earlier.

On successive Fridays in May suicide bombings at mosques of the minority Shia community in Eastern Province killed a total of 25 people.

A group affiliated with ISIL calling itself Najd Province - which takes its name from the region around Riyadh -- claimed those attacks as well as another suicide bombing that killed 26 people at a Shia mosque in Kuwait in June.

Source: Al Jazeera and agencies