An officer takes part in the search for a gunman near the Hayward DMV. (CBS)

HAYWARD (CBS SF) – A Hayward man has been arrested in connection with an officer-involved shooting outside the Department of Motor Vehicles in Hayward last week, police said Thursday.

Joshua Ross, 19, was arrested on suspicion of assault with a deadly weapon on an officer, Hayward police said.

Ross came to the attention of police around 2 p.m. on May 8 when someone reported seeing a person with a gun leaving the downtown Hayward BART station.

Police said an Alameda-Contra Costa Transit District bus driver had seen one person in a group of four males pull a gun out of a backpack.

Officers responded, located the males and stopped them on Winton Avenue, at which point Ross, who was believed to be the one with the gun, fled, running toward the DMV on Jackson Street and jumping a fence into the parking lot, police said.

An officer found him and told him to drop his weapon, police said.

Instead of dropping the gun, Ross allegedly pointed it at the officer, prompting the officer to fire at Ross, according to police.

Ross then ran off, heading onto Magna Avenue, a cul-de-sac off of Winton Avenue. Police set up a perimeter in the neighborhood and found a handgun, but Ross was able to elude authorities until his arrest on Tuesday.

Ross was taken into custody at the Alameda County Juvenile Justice Center, located at 2500 Fairmont Drive in San Leandro, after he went there for an unrelated matter, police said.

He was not injured in the shooting on May 8.

According to jail records, Ross was being held in Alameda County Jail on $160,000 bail. He was scheduled to be arraigned at the Hayward Hall of Justice this afternoon.

Because of the shooting, the DMV closed early on May 8 and didn’t open its doors until noon the next day.

Two of the three others in the group—a 17-year-old juvenile and a man—were arrested on unrelated charges, police said.

(Copyright 2013 by CBS San Francisco and Bay City News Service. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed.)