The fire broke out at the Northport Apartments in the 14000 block of Rodeo Drive shortly before 2:30 a.m. Saturday.
San Bernardino County Sheriff's Deputy Arturo Ramirez Jr. was first on the scene. He raced into the burning building after learning people were trapped.
On the second floor, he found one woman carrying her 5-month-old baby and an 11-year-old girl carrying her 2-year-old sister. He helped them out as smoke poured out of the building.
But then he saw two small hands banging on an upstairs window and raced back inside.
"I was just looking straight up and I was just trying to formulate a plan and I saw these tiny little hands beating on the window. I didn't say anything to anybody, I just said, 'That's her,' and I ran up those stairs," he said. "That was the best feeling in the world. As soon as I grabbed on to her, she grabbed me right back. It was instant. And that was just the best feeling."
The girl was staying at a friend's house for a sleepover birthday party when the blaze broke out.
"I saw the window, it was all fire by there, and I saw it cracking," said Nevaeh Nemess. "I went back in the living room and I said, 'Help, help!' banging on the window. He just picked me up and ran downstairs."
Witnesses say the blaze started on a first floor apartment and quickly spread.
Authorities say 10 units were destroyed and eight families are homeless. One man suffered minor smoke inhalation, but there were no other injuries.
Damage from the fire is estimated at $500,000. The cause of the fire remains under investigation.