Tucson police arrested a man accused of shooting at an officer last week during an attempted traffic stop on Tucson's south side, officials say.

Bernardino Grijalva, 28, was arrested last night and booked for illegally possessing a firearm and discharging a firearm within city limits, according to Tucson police spokesman Officer Ray Smith.

The officer in the incident was not in uniform and was in an unmarked police car. He turned to follow Grijalva, who sped past him going in the other direction near West Iowa Street and South 11th Avenue about 9 p.m., on Jan. 4.

Tucson police say Grijalva drove into a neighborhood and the officer temporarily lost him. While searching for him, the officer turned a corner and Grijalva’s vehicle was stopped right there. Grijalva fired four to six shots and did not strike the officer, Smith said.

The plainclothes officer did not return fire. At that point, he turned on the police lights, and Grijalva fled in his vehicle. Officers pursued Grijalva near East 38th Street and South Fourth Avenue where he left his vehicle and fled on foot, according to police.

Police served a warrant on Grijalva’s vehicle, leading to his arrest.

According to Smith, Grijalva said he didn’t know he was firing at an officer. Tucson police didn’t arrest him on charges of aggravated assault on an officer because he didn’t strike the officer and he fired shots before the officer turned on the police lights.

Contact reporter Danyelle Khmara at dkhmara@tucson.com or 573-4223. On Twitter: @DanyelleKhmara