ALHAMBRA (CBSLA.com) – A man accused of trying to lure a girl into his car in South Pasadena was arrested Thursday in neighboring Alhambra.

Edwin Linares, 43, of Alhambra was taken into custody at about 7 a.m. by a South Pasadena officer who was in Alhambra conducting an investigation and who recognized the car he was driving, the South Pasadena Police Department reported.

READ MORE: Taylor's Blunder, Other Missed Chances Put LA In NLCS Hole

On Wednesday afternoon, Linares asked a girl walking on a South Pasadena street if she needed a ride and she took a picture of his car, police said.

The girl, whose age was not released, was walking in front of South Pasadena Middle School at 1600 Oak St. at about 12:30 p.m. Wednesday, police said, when she noticed a man driving a red Toyota Corolla slowly near her.

He asked her if she needed a ride. After she refused, he asked her again. She pulled out her cell phone and snapped a picture of his vehicle as he fled east on Oak Street, police said.

READ MORE: Karen Bass Officially Kicks Off Her Run For Mayor Of Los Angeles At Saturday Event

The girl described the man as Hispanic, about 30 to 35 years old with a thin build, medium complexion, black wavy hair and a goatee. On Thursday, a South Pasadena officer saw the car, pulled it over and arrested Linares.

“I’m glad to hear from her remarks that she was actually smart to both, one, take a photo of the license plate, two, run way as fast as she can, and three, get to her home safely,” classmate Minori Milly told CBS2 Thursday.

Police said Linares was also wanted on unrelated charges of suspicion of child molestation. He is accused of having a sexual relationship with a minor, police said. The details of that case were not confirmed.

MORE NEWS: Police Investigating Shooting In South Los Angeles

(©2017 CBS Local Media, a division of CBS Radio Inc. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed. Wire services contributed to this report.)