A two-year-old girl and her grandmother had to be treated for smoke inhalation after a house fire broke out in Surrey Thursday, but it could have been much worse if not for the heroic actions of an off-duty Mountie.

Fire officials are praising Sgt. Derek King for his quick thinking after he saw smoke and flames coming from a home in the 19000-block of 71st Avenue while out for a walk Thursday night.

When King, a dog handler for the Surrey RCMP, knocked on the door, the toddler’s grandmother answered and told the Mountie her granddaughter was trapped inside.

“Without any protective gear, Sgt. King entered the home to look for the child and heard her cries for help,” Surrey Fire Chief Len Garis said in a release.

With smoke obscuring his vision, King found the toddler in a nearby room, picked her up and brought her to safety outside.

Both the two-year-old girl and her grandmother were rushed to Langley Memorial Hospital.

“It’s clear that this incident would have had a very tragic outcome, but thanks to Sgt. King’s bravery he saved a young child from serious injury or worse,” Garis said.

Fire officials say while the exact cause of the fire hasn’t been determined, the blaze does not appear to be suspicious.