A 14-year-old boy was being heralded as a hero Tuesday after he rescued an elderly man and his dog from a burning apartment building in Fairfield, California, over the weekend.

Teenager Latrell McCockran was visiting a friend's apartment when he smelled smoke.

The boy grabbed a fire extinguisher, and as he headed toward the smoke, he encountered an elderly, disabled man who was struggling to get out of his smoke-filled apartment, according to Fairfield fire Battalion Chief Matt Luckenbach.

McCockran helped the man get  out of the apartment safely, Luckenbach said.

Once outside the burning building, the elderly man told McCockran that his dog was still inside. The teen also heard that children might be trapped inside.

McCockran went back into the apartment with his father and rescued the dog while calling out for any additional occupants, the battalion chief said.

The father and son left the building as the heat and smoke became unbearable, Luckenbach said.

Firefighters arrived at the scene and later confirmed that no one else was inside at the time of the fire.

The boy was taken by his mother to a hospital for treatment of minor injuries and smoke inhalation. The elderly man's hair was singed, but he was uninjured, according to Luckenbach.

The Fairfield Fire Department said McCockran's heroic actions saved the life of a man and his dog.

Luckenbach acknowledged that while Saturday's events ended well, entering a burning building without advanced training and proper protective equipment can be life-threatening.