OAKLAND — A 25-year-old man was charged with attempted murder of a San Francisco police officer after striking him with a car during a hectic incident where an Oakland officer fired his gun into the ground, according to court records.

Joseph Willis was charged with attempted murder, three counts of assault upon a police officer with a deadly weapon, attempted carjacking and illegally possessing a gun and ammunition. The attempted murder charge, which carries a potential life sentence, requires prosecutors to prove he intended to kill the officer.

San Francisco police chased Willis, the alleged driver, and another man into Oakland during an attempted traffic stop on Tuesday, authorities said. At least one of the suspects was wanted in connection with a prior robbery, and both were suspected of multiple felonies, authorities said.

The officer was knocked back 10 feet and hospitalized with non-life threatening injuries, police said. The chase began in North Oakland and ended near Webster Avenue near 34th Street.

An Oakland police officer, who authorities haven’t identified, ended up firing a single shot into the ground while the men were being detained, according to police. Prosecutors allege Willis attempted to carjack a motorist to get away from police.

Willis is being held without bail, both in this case and for an alleged parole violation. He is set to be arraigned Friday morning, records show.