"The culprit confessed to adopting the doctrine of terrorist (group) Daesh," the spokesman said using the Arabic acronym for IS, in a statement carried by SPA state news agency.
The man, identified as Hayel al-Atawi, said he "committed the crime in response to a call by the (IS) organisation to target military personnel," the statement added.
Seven others were arrested in relation to the killing, it said.
IS leader Abu Bakr al-Baghdadi has called for attacks against Saudi Arabia, which belongs to a US-led coalition battling the jihadists in Syria and Iraq.
Since late 2014 IS has claimed a series of bombings and shootings targeting Shiites in the Sunni-majority kingdom, as well as the security forces.
----------------------------------------------------------------------------------------------------------
The man, identified as Hayel al-Atawi, said he "committed the crime in response to a call by the (IS) organisation to target military personnel," the statement added.
Seven others were arrested in relation to the killing, it said.
IS leader Abu Bakr al-Baghdadi has called for attacks against Saudi Arabia, which belongs to a US-led coalition battling the jihadists in Syria and Iraq.
Since late 2014 IS has claimed a series of bombings and shootings targeting Shiites in the Sunni-majority kingdom, as well as the security forces.
----------------------------------------------------------------------------------------------------------