A man shot and killed himself tonight in San Francisco when police officers stopped a vehicle after receiving a tip about the location of a person of interest in a homicide earlier this week in the city’s Castro neighborhood, according to police Sgt. Wilfred Williams.

The incident began when police received a tip tonight about the possible location of David Wehrer, a person of interest in a homicide, as well as an attempted bank robbery and carjacking on Tuesday, Williams said.

Officers spotted the vehicle described in the tip, and attempted a traffic stop at about 8:15 p.m. near the intersection of McAllister and Baker streets, according to Williams.

The driver of the vehicle complied with the traffic stop, but because officers could not see into the rear windows of the vehicle, an officer opened the right rear passenger door of the vehicle, and saw a person’s leg in the back seat, Williams said.

The officers attempted to pull the man out of the vehicle, and heard a single gunshot. The officers backed away from the vehicle, and saw the man step out of the vehicle and fall to the ground, according to Williams.

The man was taken to San Francisco General Hospital where he was pronounced dead at 9:07 p.m., Williams said.

Williams could not confirm if Wehrer was the man who shot himself tonight. The man’s identity has not been released pending notification of next of kin.

Wehrer, 26, was sought as a person of interest in the death of Robert “Bobby” Christopher inside the apartment at 98 Castro St. at around 6:35 p.m. Tuesday. Wehrer was believed to have been seen with Christopher and visited his house recently, Williams said.

Wehrer is also a suspect in an attempted bank robbery and carjacking Tuesday afternoon in the West Portal neighborhood.