A Downey man accused of shooting and injuring another man sitting in a car in Long Beach on Sunday morning was arrested on suspicion of attempted murder hours later, police said.

Before he was shot, the victim and a woman were in their car near 25th Street and Pasadena Avenue when Nicholas Yniguez, 24, allegedly shot at them at around 7 a.m. Sunday, according to Long Beach police. It wasn’t clear where exactly Yniguez, who knew the woman, was at when he allegedly shot at them in the car.

Investigators believe the motive of the shooting was domestic-violence related, Long Beach police spokeswoman Jennifer De Prez said.

After the man was shot in his upper torso, he and the woman went to a nearby hospital, police said. His wounds were non-life threatening.

Police arrived at the scene shortly after receiving calls of the shooting, where they found casings in the intersection, De Prez said.

“Through their investigation,” De Prez said, “detectives were able to identify and locate the suspect in the city of Downey.”

Yniguez was arrested near a gas station and strip mall in Downey, about 5 miles away from his home, arrest records show.

Yniguez was being held at the Long Beach City Jail on $2 million bail.