There was a fatal shooting Thursday evening near the busy section of Market Street outside the Westfield Mall, a few blocks from Union Square, and it involved a store security guard armed with a gun and an alleged theft in progress.

As NBC Bay Area reports, the shooting took place at the Walgreens on the 800 block of Market Street just after 6:30 p.m. The victim was taken to a hospital where he later died of his injuries.

One suspect was detained following the shooting, according to KRON4 and SFPD sources.

That suspect was reportedly a security guard at the Walgreens store, as KTVU reports. The station spoke to a witness at the scene who described a young female victim who was on her way out of the store when she was allegedly shot by the guard — it was later learned that the victim was a transgender male, and this witness had misgendered him.

"She was here with friends… she turns around walking out of the store, and all you hear is two gunshots, ‘boom boom’," said the anonymous witness. "We turn around, she on the floor, bleeding out."

This same witness, who said she was friends with the victim, spoke to ABC 7 as well, saying of the security guard, "He didn't say anything — all he did was pick up that gun and shoot twice and walk to the back. The people that were in the store started charging at her."

According to later reporting from NBC Bay Area, the suspect arrested was 33-year-old Michael Earl-Wayne Anthony, who is described as a private security guard.

The victim has been identified as 24-year-old Banko Brown of San Francisco.

Police tell NBC Bay Area that "a theft occurred" during or before the incident, but they did not elaborate.

Walgreens issued a statement saying, "We are thinking of the victim and their family during this difficult time. The safety of our patients, customers and team members is our top priority, and violence of any kind will not be tolerated in our stores. We take this matter seriously and are cooperating with local authorities."

This was San Francisco's 15th homicide of the year to date.

Update: District Attorney Brooke Jenkins is declining to file charges in the case, citing her office's belief that they will not be able to prove the shooting was not done in self-defense. Without providing further details, as the Chronicle reports, SFPD Chief Bill Scott called the incident a "shoplift gone wrong," and Jenkins said that evidence suggested "both threats of force and physical force were used" by the victim in the course of the altercation, and that the guard "believed he was in mortal danger and acted in self-defense."

Anthony, the guard, is reportedly licensed to carry a handgun as a security guard.

Photo: Google Street View

This post has been updated throughout with new information.