The US mission in Saudi Arabia said there were no children present during the attack on the Kingdom School in Riyadh.
Government-linked Saudi newspaper Okaz reported that the shooter was an Iraqi teacher who had been fired from the school.
The victims were a Saudi national and a Palestinian national, he said, while a third person was injured in the rampage. The security situation at the school has been contained.
A spokesperson for the Saudi interior ministry said the attack was being treated as a “criminal case”, rather than a terror investigation.
Saudi Arabian schools are currently closed for the summer holidays, which started before the Islamic holy month of Ramadan.