Is it safe to cook chicken in the oven to an internal temp of 170F, then turn off the oven and leave the chicken in the oven for 5 hours?

As mentioned above: No. Full stop. Do not pass go, do not collect $200. Go directly to food poisoning.

It's a common misconception that it's the bacteria that will get you sick. It's not the bacteria, but the toxins/pathogens that they produce. It's impossible to remove those toxins once they have formed, regardless of how it is reheated.

Even if you were 100% sure that every toxin producing bacteria was killed in the cooking process (which is impossible cooking to 170, as there are bacteria that will survive that temperature, and can survive temperatures exceeding the boiling point of water) you can be damned sure that there will be more bacteria forming as soon as the oven drops to temperatures compatible for bacteria to multiply. The oven is not a vacuum, and thus not proof to having bacteria enter. (And even in a vacuum, you have anerobic bacteria like botulinum that thrive in an oxygen free environment!)

Bacteria thrives in a food rich, moist and warm environment. Basically your friend is creating the perfect breeding ground for bacteria.

If you could cook it and hold it at 170 degrees, then it would be a slightly different story. Think about the current trend of sous vide cooking, where you can bring vacuum sealed food to a very specific temperature and hold it there for a (relatively) long period of time. At those temperatures you are essentially pasteurizing your food if it's held at a specific time/temp ratios. Canning is the same procedure, however both are still susceptible to already accumulated toxins and the toxins that anerobic bacteria will produce.

You are 100% correct in thinking of the "danger zone", as a temperature between 40-140 is the area that most (but not all!) harmful bacteria will reproduce and double (!) every hour. 140 will be reached pretty soon after the oven is turned off and even if you don't open the oven door, and you'd be looking at 3+ hours of potential bacteria/toxin accumulation.

In short think of it this way: if you wouldn't leave it raw at room temperature for 5 hours then cook it, it's probably pretty wise to not do the reverse.

/r/AskCulinary Thread Parent