Officers in the unmarked car went by India Basin Shoreline Park near Hunters Point Boulevard and Evans Avenue at about 12:50 a.m. and saw three vehicles and several people there, according to police.
The officers then turned their car around to leave the park, and as the vehicle was turning, it was hit by a number of bullets, police said.
Police then chased one of the vehicles and stopped it at Bryant and Ninth streets. Eight suspects have been detained, but police were not releasing any other information about them this morning.
The officers were not injured by the gunfire, and did not fire any shots in response, police said.