A Virginia Street resident contacted police around 10 p.m. Thursday, saying that she found two men in her backyard, Sgt. Doug Calcagno said.
One of the men pointed a handgun at the woman and told her to put her hands in the air, but the woman screamed for her husband and was able to run inside and call police.
Police arriving in the area spotted four men, who separated and began walking away in two different directions.
When officers approached, two of the men were detained without incident, but the other two took off running and jumping over fences, Calcagno said. They were captured and detained in nearby yards after a search that involved the use of an Alameda County Deputy K-9 team.
The two men who were captured after fleeing were identified as Delay Graham, 20, and Jo Moni Smith, 20. Graham was identified as the suspect who allegedly pointed a gun at the victim.
The two other men were identified as Tony Johnson, 22, and Louis Lee, 28. Lee was later identified by police as a parolee at large. A loaded gun was located in the area where the suspects had initially fled, Cascagno said.