FAIRFIELD (CBS13) — A man narrowly avoided hitting a toddler wandering alone in the middle of a street.

Ricky Lynn has a safety-first mentality that was born out of tragedy. He lost his 7-year-old niece over the summer after she was hit and killed while crossing the street.

READ MORE: Father, Son Being Held On $1M Bail For Allegedly Starting Caldor Fire

He says it was that vigilance that helped keep another family from going through the same loss.

“I’m always on top in terms of safety,” he said. “We had cars parked here, and I saw maybe some pink, something that was about this big over here.”

ALSO: Father Arrested After Super Gluing His Toddler’s Eyes And Mouth Shut

He was leaving church at around 8 a.m. when he realized that pink object was a little girl standing in the street. He missed her by mere feet.

READ MORE: Rain, Snow, Freezing Temperatures On Deck For Northern California

“I had to slam on the brakes,” he said. “I had to hop out of my car, left my door open, made sure the car was in park, and I ran over to grab her because I didn’t know if she was going to continue across the street.”

The toddler was scared and crying, so he and a friend from church gave her a toy to help her calm down as they waited for police to arrive.

ALSO: Vallejo Police Admit Slow Response To Report Of Toddlers On Ledge

The toddler’s mother and her family were asleep in the house when the 2-year-old wandered outside.

“The mom was still really upset, so I went over to the mom and said, ‘Listen, don’t worry about what happened. Just use all that extra energy to prevent it from happening again.'”

MORE NEWS: No Credible Information Found On Anonymous Threat To Kennedy High; Extra Police On Campus

He and the family plan to keep in touch.