NEW YORK (CBSNewYork) — A runaway dog traveled several miles on subway tracks in Brooklyn.

It narrowly avoided being hit by a train, before subway employees jumped to his rescue, CBS2’s Natalie Duddridge reported Tuesday.

They call him “Lucky.” Metropolitan Transportation Authority workers pulled the pitbull off the “L” train tracks in Williamsburg, saving his life after he was spotted limping along the rails.

“I sprung into action. I got his attention, showed him a little bit of caring. He was scared, hungry,” track inspector Edlin Cruz said.

Cruz said at around 3:40 a.m. on Monday his co-worker first noticed the puppy as the train pulled into the Wilson Avenue tracks in Bushwick.

“He had a cut on his leg, looked shaken up, nervous. He was staggering back and forth on the track, looked lost,” Cruz said.

The train just missed hitting the dog, which took off running. So the subway had to slow to a 10-mph crawl behind him for nine stops. His journey lasted 40 minutes. He had run more than three miles through the tunnels before MTA workers at the Graham Avenue station finally managed to pull him to safety.

“A couple of the guys grabbed a rope, kept him away from the platform and gave him some food, some water,” Cruz said.

The pitbull had no collar or identification, so the MTA said they handed it over to police.

Cruz said it’s a good thing the incident happened early in the morning, because eventually several trains were backed up. He had to get back to work and couldn’t stick around to find out what happened to the dog.

Now, some subway riders are holding their own pets a little tighter.

“My dog has gotten out before on these busy streets, so you do what you can and just keep an eye on her,” another said.

Cruz said he already has a pitbull at home and wishes he could have adopted the animal. This one he said he’d name after the subway station.

“Graham is cool, too,” Cruz said.

Whether it’s Graham or Lucky, the MTA workers are hoping the dog finds his owner, or a good home.

The workers also threw out the name “Wilson,” after the other subway station involved in this story, and for the lost character in the movie “Cast Away.”