CHP officer Justin McGrory had pulled over a vehicle for speeding near Hodge Road, and while he was talking to that driver, a dark car veered onto the shoulder of the freeway and sideswiped the officer.
McGrory was airlifted to Saint Mary's Hospital but did not survive.
The driver of the red 2009 Pontiac G6 that struck McGrory, 18-year-old Rafael Garcia of Las Vegas, was arrested at the scene on suspicion of vehicular manslaughter. More charges could come depending on the outcome of the investigation, authorities said.
The 15 Freeway was shut down for hours. Nobody else was hurt in the incident.
McGrory, 28, of Victorville, is survived by his wife, Kelly, and their three children, a 7-year-old daughter and two sons, ages 4 and 1.
McGrory's fellow officers saluted his body as it was taken to the coroner's office.
Friends said McGrory was fullfilling his dreams following in his father's footsteps working as a CHP officer in the Inland Empire.
"This is really kind of close to a lot of us," said CHP Sgt. Kevin Eads. "We knew his dad. I worked with him personally here at the Victorville office watching him grow up, so it's tough."
McGrory would have served his third year on the force in October.
"He was a good-natured kid, fun loving," Eads said. "He looked like he'd be a good dad and husband. He looked like he was fun to work with. I wish i would have had an opportunity.
"According to the Barstow-area officers, he was a very likeable person," CHP officer Mario Lopez said. "He got along with everybody, he was a hard worker and he's definitely going to be missed, very dearly."
McGrory is the third CHP officer to die in the line of duty in June.
The Associated Press contributed to this report.