Two California teens kidnapped following their high school prom managed to escape after one of them wrested a gun away from their attacker and then pistol-whipped him, authorities said.

The 22-year-old suspect was arrested Saturday when he went to a hospital for treatment of injuries he sustained in the fight with one of his victims, sheriff's officials in San Bernardino County said.

Jared James is accused of forcing a 17-year-old boy and the teen's girlfriend into their car at a parking lot in Victorville and driving them to an isolated area. The boy fought with James in the car, managed to pry the gun away and then repeatedly hit his attacker with it before escaping. The gun fired twice, but nobody was struck by the bullets, according to a sheriff's news release.

During the struggle, the girl ran away to find help. A truck driver drove the teens to a hospital.

The suspect, James, drove to a family member's home who drove him to another hospital, where he was arrested.

Deputies went to the scene and recovered the handgun and the teens' car.

James could face kidnapping and attempted murder charges.

Police said James, a Nevada resident, knows the girl, but didn't specify what their relationship is. Sheriff's officials didn't say whether James has a lawyer. A number for James in his hometown of Las Vegas could not be found.

He is being held in lieu of $1 million bail.