As flames engulfed two units of a fourplex early Sunday morning, a puppy alerted its family and tried to save an infant by grabbing her by the diaper and pulling her off the bed.

Sasha, an 8-month-old pit bull, was outside and started banging on the back door. When her owner, Nana Chaichanhda, let her in, the dog barked incessantly, according to KTXL.

The behavior was unusual and that's when Chaichanhda noticed her home and another building were on fire, according to KCRA. Chaichanhda raced over with Sasha by her side. Her cousin was not home.

Chaichanhda ran back to her unit and saw Sasha trying to save Masailah, her 7-month-old, according to KCRA.

"She had already had my baby by the diaper and was dragging her off the bed," Chaichanhda told KTXL. "I was like, 'Oh my gosh, what are you doing?'"

Everyone was able to escape the fire unharmed, according to KTXL.

Firefighters responded and put out the flames. The two units that caught fire were condemned. All four buildings are without electricity, according to KCRA. A GoFundMe account was created to help pay for the families to relocate.

"It meant a lot. I owe her everything. If it wasn't for her, I would have still been in bed and things could have taken a worse turn," Chaichanhda told KTXL.

The Stockton Fire Department is investigating the cause of the fire, according to KTXL.