Earlier this month, a homeless man traveled all the way from Florida to New Jersey to be reunited with his two daughters after 24 years apart. But their emotional reunion might never have happened without the help of a transit police officer who asked the man if he needed help — and then decided to take him under his wing.

Jose Lopez lost touch with his family years ago after separating from his wife and moving to Florida, CBS New York reports. At the time, his daughter Kristy was 17 and his daughter Angela was 10.

A few years ago, Lopez reconnected with his daughters over the phone. Then he went silent again. Lopez suffered a series of strokes and ended up homeless.

Get Breaking News Delivered to Your Inbox

Recently he became determined to make it back to New Jersey, where his daughters live, and he used his Social Security money to travel to the Garden State. Lopez ended up at the Secaucus Junction train station, but needed to find a way to make it to the town of Bradley Beach.

At Secaucus Junction, a New Jersey Transit police officer asked Lopez at if he needed assistance, and he said yes, he needed help finding his daughters.

Crisis Outreach Officer Sean Pfeifer stepped in and took Lopez under his wing. "Mr. Lopez was intent on finding his family, and I wanted to make sure that I was there to help him with doing that," Pfeifer said.

Pfeifer called dozens of possible family members until he found Lopez's daughters. He also got Lopez a shave and haircut before arranging for the family to reunite.

Then, after more than two decades, Kristy and Angela Viviani reconnected with their dad again. It was an emotional moment caught on camera by NJ Transit.

A tearful, heartwarming reunion! NJ Transit Police reunite a homeless man with his family after 24 years!! Jose Lopez not only got to hug his daughters, he met his grandkids for the first time! Lopez was given a shave and a haircut, plus new clothes for the big reunion moment. pic.twitter.com/puIYKRp2QW — NJ TRANSIT (@NJTRANSIT) August 20, 2019

"I remembered the eyes," Kristy Vivani said. She was able to introduce her dad to her own children for the first time. The first-time grandfather embraced his grandkids the same way he did his own children.

The reunion was also emotional for Pfeifer. "To feel their emotion, behind the camera I was tearing up," he said.

"I'm thinking I'm in heaven," Lopez said. "I've got my two best girls. I got a good friend."