A man who was killed this week inside the home of San Francisco filmmaker Kevin Epps was shot in “self-defense” after he intruded in the home and made “serious threats,” Epps and his attorney said Wednesday.

Epps, 48, who lives on the 100 block of Addison Street in Glen Park, was arrested on suspicion of murder after Monday’s shooting. But the district attorney’s office decided Tuesday not to file charges, at least for the time being, suggesting that evidence of self-defense was a consideration.

Police officials have not elaborated on what preceded the 1:30 p.m. killing of 45-year-old Marcus Polk, who was homeless and knew Epps and his family.

Epps said the shooting was “self-defense” but would not describe what happened — or even confirm if he had pulled the trigger — on the advice of his attorney, Mark Webb.

“I’m just thankful to get back to my kids and family,” Epps said. “I’m trying to be a beacon of hope and light.”

He said he hadn’t slept since the shooting, saying, “It’s been a traumatic whirlwind of emotional events. It’s heavy stuff. I just try to be strong and know what I stand on. It’s about being part of the solution.”

Webb said he did not want his client to make any statements that could be used against him.

“There was a shooting, and there was a death and it was in self-defense,” the attorney said. “The person who was killed was an unwanted intruder making serious threats of death.”

Legal analyst Steve Clark, a former Santa Clara County prosecutor who now works as a defense attorney and is not involved in the San Francisco case, said people have “a heightened right to self-defense if someone comes into your home rather than if you are outside your home.”

“The law respects the sanctity of the home to a degree where you are allowed to use deadly force where elsewhere you wouldn’t,” Clark said.

Family members and friends of the two men said Polk — a registered sex offender with a criminal history including domestic battery and attempted robbery — would often show up, unwelcome, at the home on Addison Street.

Authorities booked Epps on suspicion of murder as well as being a convicted felon in possession of a gun. But he was released from San Francisco County Jail just before 1 a.m. Wednesday after prosecutors declined to file charges.

“There is insufficient evidence to charge the case at this time,” said district attorney’s office spokesman Alex Bastian. “However, the case remains under investigation.”

San Francisco police officials said the decision by prosecutors to “request additional investigation” on a case is “not uncommon.”

“SFPD investigators work closely with the D.A.’s office, and the SFPD homicide detail will be continuing the investigation into this matter,” said Sgt. Michael Andraychak, a department spokesman.

News of Epps’ arrest shocked many in San Francisco’s arts community, where the filmmaker has been a visible presence since releasing “Straight Outta Hunters Point” in 2003. The film documented a turf war between rival gangs, providing a bleak picture of the violent and neglected neighborhood where Epps grew up.

Epps, a street hustler in his younger years, eventually escaped the trappings of the neighborhood by picking up a camera.

“I took it upon myself to try to turn a negative situation into something positive,” he told The Chronicle in a 2007 profile.

Epps has been an outspoken voice against police brutality and has worked with nonprofit organizations to help San Francisco’s impoverished neighborhoods. In 2011, he was named an artist fellow at the de Young Museum.

But Epps has also had brushes with the law. He was charged in 2002 with penetration with a foreign object in Santa Cruz County, though his attorney, Ken Azevedo, said Wednesday that the charges were dismissed in 2005 after a hung jury trial. Court papers in that case show Epps had a prior felony strike on his record; details were not available.

On Wednesday, Epps would only say, “To be a black man, it’s always trials and convictions. I’ve been subject to that.”

Being a convicted felon doesn’t mean Epps would be legally barred from using a gun to defend himself if his life was in danger, experts said.

“Even if you’re a felon, you can still defend yourself,” Clark said. “You don’t lose the right to use deadly force” for self-defense.

Another factor in the case may be Polk’s history of being accused of threatening behavior. He was served with a restraining order in September, filed by a tenant at the Vista Del Monte apartments on Goldmine Drive in Diamond Heights, half a mile from Epps’ home.

The tenant wrote that Polk moved in with him, refused to leave when asked, and once put out a cigarette on his collarbone. Polk “has threatened to do bodily harm to me,” the tenant told the courts, and declared “we’re at war” and “you’re going to pay.”

Evan Sernoffsky is a San Francisco Chronicle staff writer. Email: esernoffsky@sfchronicle.com Twitter: @EvanSernoffsky