A man was shot in the head Tuesday in front of his girlfriend and 16-year-old daughter as the three drove past a Southern California high school, according to police.

The shooter — a 15-year-old gang member who was on probation — opened fire at 3:15 p.m. in the 9400 block of Westminster Avenue in front of Bolsa Grande High School in Garden Grove, police said.

The girlfriend of the 42-year-old victim was behind the wheel when the car came to a stop. The teen shooter confronted the man as he sat in the passenger's seat, police said, adding that the victim's 16-year-old daughter watched them argue from the backseat.

The shooter then fired into the car, striking the man in the head and the back.

The wounded man's girlfriend and daughter tried to rush him to the hospital, but a 911 dispatcher told them to pull over so paramedics could treat the victim, police said.

He was taken to the hospital and is expected to survive, according to police.

Police detained the 15-year-old suspect after witnesses identified him as the shooter. He is expected to be booked on a charge of attempted murder.

A weapon was recovered, police said.

Police said the teen shooter does not attend Bolsa Grande High School, where the shooting occurred.

Editor's Note: This story was updated to clarify who was driving the vehicle at the time of the shooting. An earlier report mistakenly indicated the daughter was behind the wheel, but NBC4 has learned new information since the time of the original post.