The windows of a white Dodge Charger were shot out at about 10:20 a.m. near the intersection of Keith Street and Newcomb Avenue, police spokesman Officer Samson Chan said.
Chan said about 10 shots were fired. The vehicle was occupied by two security guards and moving at the time, but no one was injured, he said.
The shooting occurred about a block from George Washington Carver Elementary School, which was locked down until about 12:40 p.m. Several people were later detained for questioning, Chan said. The shooting is still under investigation.
According to Chan, some of the public housing communities in the Bayview District hire private uniformed security guards to protect the area. The guards are armed, he said.
During the George Washington Carver school lockdown, classes continued inside, but no one was allowed to enter or exit the building, San Francisco Unified School District spokeswoman Gentle Blythe said.
Blythe said the lockdown was just a precaution and that school staff members are familiar with the procedure because police activity in the area is fairly common.
"The school is really a safe haven in that neighborhood for those children," she said. "Violence around the school has never entered the school, that I know of."