San Francisco filmmaker Kevin Epps will not be charged in the fatal shooting of a man in Epps’ Glen Park home, the district attorney’s office said Tuesday night.

Epps, who was arrested on suspicion of murder shortly after the shooting Monday afternoon, was expected to be released from San Francisco County Jail by the end of Tuesday night. The district attorney declined to file charges citing insufficient evidence at this time, officials said.

The arrest of Epps had shocked his friends and others who appreciated his nearly two decades of work, documenting the effects of violence in San Francisco’s poorest and most neglected neighborhoods. His gritty films won accolades and established Epps — who spoke of escaping his own past as a street hustler — as an artist with an original perspective.

Friends said Tuesday, before learning of Epps’ release, that the 48-year-old man who grew up in Bayview-Hunters Point was gentle and committed to his community and work.

“This is one of the last things I would expect to hear,” said Stanley Cox Jr., better known as Oakland rapper Mistah F.A.B., who was featured in Epps’ 2006 documentary, “Rap Dreams.”

“He’s one of those guys that you idolize,” Cox, 34, said. “We developed a big brother/little brother relationship. He became my big brother and mentor because of the work he did in the community.”

Epps had been booked on suspicion of murder and being a felon in possession of a gun in connection with the killing just after 1:30 p.m. Monday at his home on the 100 block of Addison Street. Epps declined to be interviewed after speaking with an attorney from the San Francisco public defender’s office.

Inside Epps’ house, detectives found a 45-year-old man dead from a gunshot wound. Friends and family members of the victim identified him as Marcus Polk and indicated the two men knew each other. But police would not elaborate on what happened or discuss a possible motive.

According to court records, Polk was a registered sex offender with prior convictions for attempted robbery and domestic battery.

It wasn’t immediately clear why Epps was barred from possessing a gun, but Santa Cruz County Superior Court records show he was charged with two felony counts of penetration with a foreign object in 2002, not long after his breakout 2001 documentary, “Straight Outta Hunters Point,” which captured the rough neighborhood where he grew up. Details of that case were not immediately available.

What brought Polk to the home on Addison Street is unclear, but on Tuesday afternoon, a woman walked up the home’s weathered wooden walkway, lighting a candle outside the locked door and leaving behind a condolence note.

The woman, who declined to give her name, saying she wanted to respect the family, said she had known Polk for a decade — ever since the two used to take drugs together in “the darker corners of the neighborhood.”

Now sober, the woman said Polk had entered a spiral of homelessness and drug addiction 10 years ago, when his mother, whom he had been living with, died. He would sporadically show up at the house on Addison Street where two of his children lived, often unwelcome and always causing problems, the woman said.

“He’d show up out of the blue when he was out of jail,” she said.

The woman said Polk showed up at her doorstep as recently as a year ago, asking for food and, above all, some company. “It hurts so bad,” the woman said through tears. “I miss his friendliness. He was so sincere, a sincere friend.”

Half a mile away at the Vista Del Monte apartments on Goldmine Drive in the Diamond Heights neighborhood, residents recalled Polk’s recent eviction from an apartment that was a suspected drug den.

The complex’s assistant manager, Lena Gilbert, said she served Polk a restraining order that was filed by the apartment’s tenant. That man filed for the order in September, saying in court papers that Polk had no right to live there and “once burned a cigarette on my collar bone.”

Evan Sernoffsky and Michael Bodley are San Francisco Chronicle staff writers. Email: esernoffsky@sfchronicle.com, mbodley@sfchronicle.com Twitter: @Evan Sernoffsky, @michael_bodley