We propose a hard expectation-maximization-based normalized matched filter (EM-NMF) for the detection of chemical warfare agent (CWA) clouds under background contamination. The NMF, which is one of the most powerful detectors, requires background statistics calculated from a background training dataset. However, in practice, because the training dataset is likely to contain CWA-on background pixels, the performance of the NMF is severely degraded. This phenomenon is referred to as background contamination. To address this issue, we propose an algorithm that estimates the posterior probability of each pixel belonging to either the background or the CWA class. The optimal posterior probabilities are obtained by maximizing the loglikelihood of a contaminated dataset using the EM algorithm. Based on the posterior probability, we extract CWA-free background pixels from the contaminated dataset and design a hard EM-NMF with extracted CWA-free background pixels. We demonstrate that the proposed algorithm is an effective solution for background contamination, via experimental results conducted with actual CWA data measured by a Bruker HI-90 instrument in an outdoor setting as well as synthetic CWA data.