The government's National Cyber Security Centre said yesterday the attack involved the use of "Powershell" malware, but it did not comment on the source of the attack or which government bodies were targeted.
"The NCSC has detected a new Advanced Persistent Threat (APT) that is targeting Saudi Arabia," the agency said in a statement, adding the attack sought to infiltrate computers using email phishing techniques.
Saudi Arabia has come under frequent cyber attacks, including "Shamoon", the aggressive disc-wiping malware employed in attacks against the Saudi energy sector in 2012.
US intelligence officials at the time said they suspected a link to the kingdom's regional rival Iran.