A cocker spaniel named Simba miraculously survived an encounter with the third rail of the CTA Brown Line tracks early Monday on the Northwest Side.

The 10-year-old canine went missing late Sunday as his owners futzed with a garage door that wasn’t working properly in the 4300 block of North Lawndale Avenue in the Albany Park neighborhood.

“We immediately started looking around the neighborhood,” said Frances Jimenez, who’d just returned home from a double shift as a nursing assistant and was looking forward to bed when she realized her dog was gone.

“He’s like our baby, a part of the family,” she said, noting she and her husband filed a police report in the wee hours of the night.

She was about to start posting flyers around the neighborhood when she got a call from her daughter, who found the pup at the city pound, 2741 S. Western Ave.

Simba had apparently wandered about a mile before attempting to cross the CTA Brown Line tracks near the Kedzie stop about 5:45 a.m. as a train approached.

CTA employees noticed the dog, cut electricity to the tracks and safely rescued the canine, according to CTA spokeswoman Irene Ferradaz.

Simba apparently came into contact with the third rail three times, but was doing just fine and was back home Tuesday afternoon, Jimenez said.

“It’s a miracle he’s alive, and it’s a wonderful thing to know there are people out there willing to help,” she said.