The Prophet ﷺ said, "A man will come holding another man by the hand and say, 'My Lord, this man killed me.' Allah will ask him, 'Why did you kill him?' He will reply, 'I killed him so that the glory would be Yours.' Allah will say, 'Indeed, it is Mine.'And another man will come holding another by the hand and say, 'This man killed me.' Allah will ask him, 'Why did you kill him?' He will reply, 'So that the glory would belong to so-and-so.' Allah will say, 'It does not belong to so-and-so,' and he will bear the burden of his sin."
عن النبي ﷺ قال: يجيء الرجل آخذا بيد الرجل، فيقول: يا رب هذا قتلني، فيقول الله له: لم قتلته؟ فيقول: قتلته لتكون العزة لك. فيقول: فإنها لي، ويجيء الرجل آخذا بيد الرجل فيقول: إن هذا قتلني. فيقول الله له: لم قتلته؟ فيقول: لتكون العزة لفلان. فيقول: إنها ليست لفلان فيبوء بإثمه.
Nasai (3997) and Bayhaqi (8/191) both narrated it from the hadith of Mutamir, from his father, from Amash, from Shaqiq bin Salama, from Amr bin Shurahbil, from Abdullah bin Masud, who mentioned it. Its chain of transmission is sahih.