Saudi Arabia said three civilians were killed and 36 people injured in two separate attacks in the capital, Riyadh.