LIVERMORE (CBS SF) — Livermore police have arrested a suspect who they say opened fire on an officer early Thursday morning.

Miguel Alvarez was taken into custody at his Tracy home after a 12-hour hunt for the suspect who shot at Livermore police Officer Dirk Stoddard, police said.

Stoddard was among the Livermore officers who responded at 12:51 a.m. to a report of shots fired in the area of Chestnut and North I streets.

When the officers arrived, they saw a male suspect about 6 feet tall who was shirtless and wore blue jeans as he walked east on Chestnut Street, police said.

The officers tried to make contact with the suspect, who continued walking east on Chestnut before turning north onto North I Street, where he ducked behind a vehicle, according to police.

When Stoddard approached, the suspect suddenly turned and without provocation fired multiple shots at the officer, who ducked into his patrol car to avoid the gunfire and was uninjured, police said.

The officers at the scene did not return fire toward the suspect and no injuries were reported to any officers or residents in the incident, police said.

The suspect fled north on North I Street and then east onto Park Street. Officers set up a perimeter in the area and searched yard-to-yard, but couldn’t find him.

Investigators eventually identified Alvarez and tracked him to his Tracy home, where he lives with Lizbeth Gonzalez. Both were arrested at 12:39 p.m. and then booked into Santa Rita Jail.

Alvarez was booked on suspicion of attempted murder of a police officer. Gonzalez was arrested on suspicion of an earlier unrelated incident of reckless discharge of a firearm, police said. Both have extensive criminal histories, according to police.

© Copyright 2015 by CBS San Francisco and Bay City News Service. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.