UPDATE 8/2:Weld County District Attorney's Office Spokesman Tyler Hill told the Longmont Times-Call that Rourke deemed Anderson's possession of the gun used in the shooting legal, despite his prior felony convictions.

ORIGINAL STORY: The suspect in a fatal shooting outside a Longmont Walmart last week will not face criminal charges, the Weld County District Attorney's Office announced Tuesday.

Joseph Anderson, 34, of Northglenn was arrested in Loveland on July 26 on suspicion of second-degree murder after he reportedly shot 33-year-old Keith Williams three days earlier at the Longmont Walmart.

Weld County District Attorney Michael Rourke declined to file charges against Anderson after statements from witnesses, evidence and an investigation by the Longmont Police Department determined that Anderson was acting in self-defense when he shot Williams, according to a news release.

More:Trial begins for Loveland UFO enthusiast in child pornography case

According to the district attorney's office, Anderson was reportedly meeting with a female acquaintance in the parking lot when Williams showed up and appeared angry. The woman said she and Williams had recently broken up, according to the news release.

Williams then reportedly grabbed a tire thumper and aggressively approached Anderson. Surveillance video shows the two fighting briefly before Anderson shot Williams once at close range, according to the district attorney's office.

Williams was transported to Longmont United Hospital, where he later died from a single gunshot wound to the chest.

"This was a difficult case to sort through, so I would like to thank the Longmont Police Department for their diligent investigation," Rourke said in a statement. "We hate for anyone to lose a life, and we can't imagine the pain the victim's family must be going through. However, in this particular case, the evidence points to self-defense, so in the interest of justice, charges will not be filed."

More:Defense: Stabbing witness attempting to manipulate jury

According to the district attorney's office, unlike in traffic incidents, it is not illegal to leave the scene of a shooting.

"By law, he had no obligation to stay at the scene, even it being self-defense," said Tyler Hill, communications director for the district attorney's office.

Anderson was released from custody Tuesday following the notification that charges would not be filed.

More:What you need to know: Fort Collins stabbing trial