Jesus Medrano, 20, of Oakland, and Giovanni Navarro, 21, of Walnut Creek, were apprehended after trying to flee the scene where a 22-year-old man was wounded, sheriff's spokesman Jimmy Lee said.
At about 11:45 p.m. Sunday, a team of sheriff's deputies was patrolling Solano Avenue in Bay Point when they heard gunshots, Lee said.
Deputies then saw a man run down the street and get into the passenger side of a waiting that sped off at a high rate of speed, Lee said.
The man who had entered the car then got out it, ran and jumped over fences into backyards while deputies caught up with the car and detained the driver, Lee said.
Other deputies at the scene approached the wounded man who was suffering from non-life threatening injuries in first block of Solano Avenue, Lee said.
Deputies set up a perimeter in the area where the other suspect was seen, conducted a yard-to-yard search and soon found him hiding in a backyard, Lee said.
Medrano and Navarro were arrested on suspicion of attempted murder and booked into the Martinez Detention Facility, Lee said.