SAN RAMON -- A man was arrested on suspicion of kidnapping, domestic battery and illegal use of a firearm on Saturday after police say he held his child's mother against her will and pistol-whipped her outside a motel.

Officers were called just before 7:30 a.m. to 18000 San Ramon Valley Blvd. for a report of a man with a gun and a possible kidnapping that was in progress at the Extended Stay America, said Sgt. Pat Cerruti.

When officers arrived, the victim -- an 18-year-old Sacramento resident -- told police that she agreed to go for a ride with her ex-boyfriend who she had a child with. A preliminary investigation revealed that while the two were in the vehicle, the victim's ex-boyfriend, Daniel Richard Medina, 24, pulled out a handgun and held her against her will, Cerruti said.

The victim convinced Medina to drive back to the Extended Stay America, where the victim attempted to get help from office staff. Police said Medina barged in, dragged the victim out by her hair and then pistol-whipped her. When two witnesses attempted to intervene the suspect pulled a firearm on both men, police said.

Officers arrived on scene, they arrested Medina and the victim was released. She declined medical attention, police said.

The gun was recovered in the suspect's vehicle. Medina was booked into the County Jail.

Contact Natalie Neysa Alund at 510-293-2469. Follow her at Twitter.com/nataliealund.