The officer was traveling north on North P Street at 2:28 a.m. when he reported seeing debris in the roadway underneath the railroad overpass just north of Railroad Avenue, according to police.
The officer activated his emergency lights and notified police dispatch that he was going to clear the debris from the roadway, police said.
But moments after getting out of his police vehicle, the officer requested emergency assistance because three or four people were throwing rocks and chunks of concrete at him from the overpass, according to police.
The suspects, who remain outstanding, were last seen running away west on the railroad tracks, police said.
The officer was struck in the head in the attack and suffered moderate injuries. He was taken to ValleyCare Medical Center to be treated for his injuries and has since been released, police spokesman Officer Steve Goard said.
The officer, whose identity is being withheld, has been placed on medical leave due to his injuries, police said.
Investigators determined the chunks of concrete used in the attack were between 8 and 14 inches in size, while the rocks thrown were pieces of granite that line the railroad tracks and are about 3 inches in diameter, according to police.
Police believe the suspects planned the attack and intended to injure the officer.
Anyone with information about the suspects in the attack is urged to call Livermore police at (925) 294-7531.