An endospore is a dormant, tough, and non-reproductive structure produced by a small number of bacteria from the Firmicute phylum. The primary function of most endospores is to ensure the survival of a bacterium through periods of environmental stress. They are therefore resistant to ultraviolet and gamma radiation, desiccation, lysozyme, temperature, starvation, and chemical disinfectants. Endospores are commonly found in soil and water, where they may survive for long periods of time. Some bacteria produce exospores or cysts instead.