The Islamist extremist group ISIS claimed responsibility for the explosion, saying it was caused by a suicide bomber.
Investigators do believe a suicide bomber caused the blast in the mosque, which is located inside an emergency force headquarters building in the kingdom's Asir region, the SPA reported, citing an Interior Ministry spokesman.
Officers were participating in noon prayers in the mosque when the blast happened. Ten of the 13 killed were emergency force members; the rest were others who worked at the site, SPA reported.
The kingdom's special emergency force, answering to the Interior Ministry, comprises quick-response security officers used for a variety of situations, including rescues, riot control and other police actions.
ISIS' statement claims the emergency force played a significant role in torturing ISIS supporters.
The statement was distributed on Twitter through accounts known to support ISIS.
This is the third Saudi Arabia mosque attack claimed by ISIS since May.
On May 22, a suicide bomber detonated himself, killing 21 people, at the Imam Ali mosque in the Persian Gulf-area village of Qudayh, in one of Saudi Arabia's few Shiite population centers in the majority Sunni kingdom.
A week later, a man disguised as a woman blew himself up -- killing three people -- outside a mosque in a predominantly Shiite neighborhood of Damman, the capital of Saudi Arabia's oil-rich Eastern Province.
In July, Saudi Arabia's government said it had arrested 431 people with alleged ISIS ties, some of whom the kingdom said were involved in the May bombings.
The Asir region, where Thursday's attack happened, includes a small portion of the kingdom's border with Yemen. Saudi Arabia has launched numerous airstrikes in Yemen this year in support of that country's deposed president, targeting Houthi rebels who took over Yemen's capital.