Sunan an-Nasa'i #4096
The Book of Fighting [The Prohibition of Bloodshed] 37:131
It was narrated that Abu Ja'far said:
"I was sitting with Suwaid bin Muqarrin, and he said: The Messenger of Allah [SAW] said: "Whoever is killed defending himself against injustice, he is a martyr."