The shooting was reported at about 11:15 p.m. near the Castro Valley Boulevard on-ramp to westbound Highway 580.
Deputies pulled over a Buick that had a stolen license plate from a Honda on it. After the car stopped, the driver tried to flee on foot but was tackled by deputies, sheriff's spokesman Sgt. J.D. Nelson said.
A passenger in the rear of the car then got into the driver's seat and tried to drive away. He began to struggle with a sheriff's deputy, prompting another deputy to open fire, striking the suspect in the torso, Nelson said.
The suspect was taken to a hospital where he was in critical condition as of this morning, according to Nelson.
A female passenger in the car was uninjured in the incident and was also taken into custody, Nelson said.
The names of the suspects were not immediately available, Nelson said.