A suspected burglar who attempted to enter a California home through the chimney died Saturday after the homeowner lit a fire without realizing the intruder was inside, police said.

The man appeared to have climbed into the chimney during the night while the owner was away and then became stuck, according to the Fresno County Sheriff’s Office.

The owner of the home in Huron lit a fire in his fireplace Saturday afternoon but then heard a man yelling inside the chimney as the house filled with smoke, the sheriff’s office said in a statement.

The homeowner tried to extinguish the flames but firefighters who dismantled the chimney during a rescue effort found the suspect dead inside, the sheriff’s office said.

The deceased man was identified by the coroner’s office as Cody Caldwell, 19. The cause of death was determined to be smoke inhalation and burns.