San Francisco Police investigate the suspect's vehicle at the scene of a two car vehicle crash that left two people dead in San Francisco, Calif. at the corner of 21 St. and South Van Ness Ave. on Tuesday Jan. 1, 2013.

Photo: Michael Macor, The Chronicle

San Francisco Police investigate the suspect's vehicle at the scene...

Image 2 of 6

San Francisco police investigate suspect's vehicle at the scene of a two car vehicle crash that left two people dead in San Francisco, Calif. at the corner of 21 St. and South Van Ness Ave. on Tuesday Jan. 1, 2013.

Photo: Michael Macor, The Chronicle

San Francisco police investigate suspect's vehicle at the scene of...

Image 3 of 6

The vehicle that was struck by the suspect's vehicle came to rest in front of a liquor and grocery store as San Francisco police investigate the scene of a two car vehicle crash that left two people dead in San Francisco, Calif. at the corner of 21 St. and South Van Ness Ave. on Tuesday Jan. 1, 2013.

Photo: Michael Macor, The Chronicle

The vehicle that was struck by the suspect's vehicle came to rest...

Image 4 of 6

San Francisco Police Chief Greg Suhr, (center) walks the scene as police investigate a two car vehicle crash that left two people dead in San Francisco, Calif. at the corner of 21St. and South Van Ness Ave. on Tuesday Jan. 1, 2013.

Photo: Michael Macor, The Chronicle

San Francisco Police Chief Greg Suhr, (center) walks the scene as...

Image 5 of 6

The body of one of the victims lies in front of a small liquor store as San Francisco police investigate the scene of a two car vehicle crash that left two people dead in San Francisco, Calif. at the corner of 21 St. and South Van Ness Ave. on Tuesday Jan. 1, 2013.

Photo: Michael Macor, The Chronicle

The body of one of the victims lies in front of a small liquor...

Image 6 of 6

San Francisco Police Chief Greg Suhr, delivers the details at the scene as police investigate a two car vehicle crash that left two people dead in San Francisco, Calif. at the corner of 21St. and South Van Ness Ave. on Tuesday Jan. 1, 2013.

A San Francisco man who allegedly killed two people in a car crash while fleeing from police in the Mission District is a gang member who tried to shoot three teenagers minutes before the collision, police said Wednesday.

David Morales, 19, has been booked on suspicion of murder and attempted murder for the deadly chain of events that began early New Year's Day, police said.

Investigators said Morales drove his black Chevrolet Impala to the Valencia Gardens housing project at 14th and Guerrero streets about 7:45 a.m., where he fired a gun at three males - ages 15, 18 and 19 - after issuing what police called "a challenge," authorities said. The gunman then fled.

None of the teenagers was hurt, and witnesses called police about the gunfire. Officers said they stopped Morales several blocks away a few minutes later because his car matched the witnesses' descriptions.

As police approached him, Morales allegedly sped away east on 21st Street, ran a red light and hit a Toyota sedan traveling north on South Van Ness Avenue.

The collision sent the Toyota spinning into the intersection and slamming into a pedestrian. It came to rest at the entrance of Muzio's Wine Liquor corner store.

The pedestrian, 26-year-old Francisco Gutierrez of San Francisco, was killed, as was a 29-year-old woman who was a passenger in the Toyota. Authorities have not released her name.

The Toyota's driver was taken to a hospital with life-threatening injuries, but his condition was upgraded to serious Wednesday, said police spokesman Officer Gordon Shyy.

Morales was booked on suspicion of two counts of murder, three counts of attempted murder, one count of evading a peace officer, and one count of being a felon in possession of a firearm with a gang enhancement charge, Shyy said.

"The element to the crime of murder is premeditation," Shyy said. "By choosing to flee and ultimately killing two people, we have reason to believe there's enough for a murder charge."

Shyy would not say with which gang Morales is allegedly affiliated.

The district attorney's office is reviewing the case, said spokeswoman Stephanie Ong Stillman. Morales could be arraigned as early as Thursday, she said.