A passenger in a car survived being shot in the head by an assailant who opened fire on the vehicle early Monday in Holtsville, police said.

Detectives believe the 12:40 a.m. shooting at the intersection of North Ocean and Long Island avenues was not a random act, Suffolk County police said.

advertisement | advertise on newsday

Police identified the victim only as a 29-year-old Brentwood man and said he was transported to Stony Brook University Hospital “for treatment of non-life-threatening injuries.” His condition was not immediately known.

The victim was in the backseat of a 1999 Honda Civic that was stopped at the intersection when someone “fired multiple shots into the vehicle,” striking him, police said.

The driver then drove to an undisclosed location in Patchogue, where the police were notified of the shooting.

Sixth Squad detectives are investigating.