A man accused of nearly killing his ex-girlfriend in San Jose and then kidnapping his own daughter ended up being captured on the Central Coast by a crowd who recognized him from an Amber Alert.

Victor Magana was taken into custody Monday in San Luis Obispo County thanks in part to the work of vigilant citizens, San Jose Police Sgt. Enrique Garcia said.

The 24-year-old Magana allegedly stabbed his ex-girlfriend Sunday night before taking their 2-year-old daughter, prompting a statewide Amber Alert. The toddler was with him when he was captured and is safe, officials said.

Police said Child Protective Services is working on reuniting the girl with family members. The toddler's mother is hospitalized in critical condition.

Garcia said Magana was driving the vehicle listed in the Amber Alert description when he stopped at a gas station in Cambria to refuel. Someone at the gas station recognized him and the vehicle and also saw the girl inside the vehicle.

"Apparently, some citizens blocked the suspect in and they detained him until the local enforcement arrived and took him into custody," Garcia said.