It is narrated from Sayyiduna Ibn Abbas (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) said: "Never stand by any person who is being killed unjustly, for a curse descends upon those who are present there and do not defend him; and never stand by a person who is being beaten unjustly, for a curse also descends upon those who are present there and do not defend that wronged person." Imam al-Tabarani and Imam al-Bayhaqi recorded this hadith with a hasan (good) chain.
Hadith Referenceإتحاف الخيرة المهرة بزوائد المسانيد العشرة / كتاب الحدود / 3547