Nipsey Hussle was in the middle of a good deed right before he was gunned down in front of his store ... where he was trying to help out an old friend who just got out of prison.
Sources connected to Nipsey tell TMZ ... the reason he was at his Marathon Clothing store Sunday is because he was trying to hook up his ex-con pal with some new gear so he could look good before meeting up with his own family and friends later in the day.
We're told Nipsey's friend had just walked out of the pen after 20 years behind bars.
Our sources say Nipsey didn't notify his team or his primary security guard he'd be going to the store solo -- it was a spur of the moment thing ... we're told no one in his camp was aware he'd left home.
Nipsey's friend is one of the other two people who were injured in Sunday's shooting -- we're told the third guy was the friend's nephew, who drove him to Marathon Clothing.
We broke the story ... a man walked up on Nipsey and co. and fired multiple rounds before fleeing in a waiting car. The shooter circled back to shoot Nipsey multiple times, not to mention kicking him in the head before leaving. Nipsey died from his wounds.
Police have identified 29-year-old Eric Holder as the suspected gunman -- who they finally brought into custody Tuesday after a 2-day manhunt.
The LAPD believes Holder shot Nipsey over a personal dispute. Our sources tell us Nipsey shunned the guy after he tried approaching him for a convo, because he pegged him for a snitch. Holder allegedly returned shortly thereafter with a gun and opened fire.