CASTRO VALLEY (CBS SF) — A suspect in a Castro Valley robbery and burglary was arrested following a late Tuesday night police pursuit and crash, authorities said.

Alameda County Sheriff Sgt. J.D. Nelson said the suspect — whose name has not been released — was also being investigated for possibly being involved in additional recent armed robberies in the Castro Valley and San Leandro areas.

READ MORE: UPDATE: Phish Fan Injured After Being Fallen On at SF Chase Center Concert Describes Brush with Death

According to Nelson, at about 11 p.m. Tuesday, deputies received a report of a residential burglary in Castro Valley in which an armed man burglarized his ex-girlfriend’s home and then left.

A short time later, deputies received a report that the same man allegedly robbed a Chevron gas station on Castro Valley Boulevard in Castro Valley and then drove off.

READ MORE: COVID: Marin Health Officials Urge Seniors To Get Booster Vaccine Shots As Holidays Loom

Deputies pursued the suspect and the suspect crashed his car on Beech Street in Hayward. The suspect got out of his car and tried to run away but deputies caught up to him and arrested him.

At about the same time, a male juvenile walked into Eden Medical Center in Castro Valley suffering from a gunshot wound to his groin, Nelson said.

Investigators said the juvenile accidentally shot himself and possibly was connected to a robbery at the 7-Eleven store on Redwood Road in Castro Valley and a robbery at the Chevron station in Castro Valley late Tuesday night.

MORE NEWS: San Francisco, Tourism Industry Offer Cash Rewards To Stop Auto Burglary Fencing Operations

Nelson said the juvenile was still being treated at Eden Medical Center and authorities were trying to determine if he’s connected to the adult suspect.