A system for sanitizing an enclosed structure has a plurality of sensors, a germicidal ultraviolet light source, and a controller. A first sensor detects the presence of humans or animals within the enclosed structure, and a second sensor detects the position of at least one door of the enclosed structure. The ultraviolet light source provides electromagnetic radiation in the ultraviolet range. The controller receives inputs from the first and second sensors and instructs emission or cessation of emission of the electromagnetic radiation based on the received input.