San Francisco police said officers shot a man multiple times in the parking lot of the Mission District police station Sunday evening after he displayed erratic behavior and appeared to challenge the officers with what turned out to be a fake gun.

The suspect later died in the hospital, police said.

Around 5:20 p.m., police noticed a man who was inside the police station parking lot, located at Valencia and 17th streets, said Officer Albie Esparza. Esparza said the parking lot is restricted and is not open to the public.

Three police sergeants approached the man and asked him to leave, Esparza said. He began to walk away but stopped before reaching the parking lot entrance at Valencia Street and turned to confront the officers.

Still facing the sergeants, Esparza said the man began to back away while also reaching his hands into his waistband, revealing the butt of a gun.

"The sergeants saw the butt of the weapon as he pulls it out and brandishes it at the sergeants," Esparza said.

Two of the sergeants fired their weapon at the man, striking him multiple times, he said.

A witness at the scene said he heard six or seven shots fired.

Esther and Cristina Vigil also said they could hear gunshots.

"Those are gunshots. I think it was like four of them, and that’s all you heard," Esther said. "Then, you heard nothing but sirens after that."

"It sounded fast like exactly like the fireworks that you throw on the ground, so it's like consistent, one after another," Cristina said.

The suspect was transported to San Francisco General Hospital, where he underwent surgery but later died.

Esparza described the suspect as a 32-year-old white man.

Police discovered later that he was carrying an airsoft gun, which can shoot pellets, but not bullets, Esparza said.

"We don't know his motive or why he challenged the officers or approached them in the first place," Esparza said. "It was very erratic behavior by the suspect, very unusual."

Esparza said the same man tried to interact with officers earlier in the day at 16th and Mission streets.

The man approached two officers, who were responding to a report of domestic violence, and asked them what kind of weapons they carry, what kind of ammunition they use, and if they had been involved in shooting any suspects, Esparza said.

"(The officers) didn't really interact with him" at the time, Esparza said. "They were busy on a call and he was sort of loitering around."

Esparza said he does not yet know the suspect's name.

No police officers were injured, he said.

As of 9 p.m., Valencia Street in San Francisco has reopened. The street had been closed to all vehicles, pedestrian, and bicycle traffic between 17th and 19th streets.