The rare shooting happened at Kingdom School, which is owned by billionaire Prince Alwaleed bin Talal.
Police were hunting a suspect of Iraqi origin, a security source said, describing the suspect as a teacher.
The man "who was dismissed from the school four years ago on the basis of anger issues and an unstable personality" opened fire at the administration offices, Talal Al Maiman, the school chairman, said in a statement.
Maiman gave no further details of the victims or suspect but called the gunman "disgruntled".
The security source identified the victims as a Saudi and a person of Palestinian heritage.
The 6 most mysterious unsolved murders of all time
"A teacher took a gun and then he went to the school room and he killed the assistant school principal and one of the employees," said the source who asked not to be identified because a formal statement would come later from Riyadh police.
Investigators were treating the case as a criminal matter and "not a terrorist incident," the source said.
Saudi media spoke of "disagreements" between the suspect and victims.
"There has been a shooting at Kingdom School in Riyadh," the US embassy said in a Twitter post, urging people to avoid the area.
"School (is) closed, no children present," it added.
There has been a shooting at Kingdom School in Riyadh, shooter still at school. School closed, no children present. Please avoid area.
— American Citizen Services Saudi Arabia (@KSA_ACS) May 31, 2017
By late afternoon an AFP photographer observed only one police car entering the school grounds, which were quiet.
Most schools in Saudi Arabia are on holiday.
Nobody answered the school's main phone line, and mobile numbers listed in the school handbook were either off or unanswered.
Kingdom School is part of a group owned by Prince Alwaleed bin Talal, chairman of Kingdom Holding Co. whose diversified investments include Citigroup and Time Warner.
The school, which has several buildings, opened in 2000 and offers boys' and girls' education from kindergarten to high school, according to its website.
The school has both a Saudi curriculum and an international programme leading to an American diploma.
Kingdom Holding says on its website that the schools group has more than 4,000 students and 300 teachers at various locations in Riyadh.
Since 2014 the Islamic State group has claimed bombings and shootings that killed dozens in Saudi Arabia, targeting minority Shia and members of the security forces.
But criminal shootings with multiple victims are unusual.
In February last year a teacher reportedly killed six people at an education department office in the southern region of Jazan.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ