Nine corrupt men swore to attack Salih and his family by night. Allah turned their plot against them.
Qur'an: 'There were in the city nine men who caused corruption in the land and did not reform' (27:48). They said: 'Swear to each other by Allah that we will attack him and his family by night, then tell his guardian that we did not witness the killing of his family' (27:49).
Qur'an: 'They planned a plan, and We planned a plan, while they did not perceive. So see how was the outcome of their plan: We destroyed them and their people, all together' (27:50–51).