This past Saturday in Secaucus, New Jersey, Kristie Ann Ramos found herself in a terrifying quandary. Her small Dachshund, Khaleesi, was stuck in one of the city’s drain pipes.

To show first responders that Khaleesi was trapped, Ramos and her husband, Emilio, lowered a PVE pipe with an iPhone attached to it into the six-inch-wide pipe they suspected she was in.

As the couple had predicted, the phone captured footage of Khaleesi. She had first entered a horizontal pipe, then got stuck as she tried climbing into a vertical one.

Rescue efforts ensued, with volunteers working alongside members of the Secaucus Fire Department. Even the city’s mayor, Michael Gonnelli, made an appearance, staying at the site for hours to assist the rescue workers. When it got too dark to work, they reluctantly decided to call it quits until morning.

It was undoubtedly a long night – not just for Khaleesi’s guardians, but for those invested in saving her life. Secaucus Battalion Chief Joseph Shoendorf, who is also a dog lover, later said: “I basically could not sleep. I was tossing and turning last night thinking about the situation.”

The search resumed on Sunday. Firefighters used hydraulic tools to dig and cut several feet of pipe to get to Khaleesi; then, they used the “jaws of life” to free her. Finally, after a 20-hour ordeal, the pup was reunited with her owners.

Khaleesi appeared to be unharmed, but was immediately taken to the vet to make sure. Through tears, Ramos left some parting words in an interview with CBS2, stating: “Those men are incredible… I was so grateful that’s she’s not hurt… she’s been in there nearly 24 hours.”

Ramos also thanked everyone involved in Khaleesi’s rescue, including Mayor Gonnelli, the Secaucus Fire Department, and volunteer firefighter Walter Francis.