The incident occurred during Asr prayers in a mosque in Ortawwiyah in the Majmaah district, about 30 km from the Riyadh city center.
After police arrived at the crime scene, they found Mohammed Rafiq Tajul Islam, 32, a Bangladeshi worker, lying in a pool of blood beside an Indian worker, who was alive with two gunshot wounds, Arab news reported.
The condition of the injured Indian, whose identity was withheld by the police, was stated to be out of danger.
The police arrested the perpetrator and said he is a psychiatric patient at a nearby hospital.