The large numbers of 3,4-methylenedioxy-N-methylamphetamine (MDMA) formulations encountered by the police and border security necessitates the need for safe, rapid and reliable tests to be performed on-site. Near-infrared (NIR) spectroscopy is a promising technique for on-scene illicit-drug detection because of its rapid analysis, non-invasive nature, broad scope to detect various substances, and small-sized sensors suitable for portable operation. The NIR spectrum of MDMA shows an intriguing, intense peak at ∼2000 nm that was found characteristic for MDMA within a large set of drugs and drug-related substances. Herein, we show that this peak can be attributed to water molecules of crystallization in the MDMA lattice. Drying experiments showed that both an anhydrous and hydrated form of MDMA·HCl exists with significantly different NIR spectra. At ambient conditions, the anhydrous form converted back to the hydrated form within 2 months. Our data analysis model was able to identify MDMA·HCl in mixtures of both forms. Assessment of seized casework materials showed that the majority of MDMA·HCl in The Netherlands is of the hydrated type. This is explained by the use of water-containing concentrated hydrochloric acid in the final conversion step of MDMA-base to the hydrochloride salt in clandestine laboratories. These findings provide insight in the challenges associated with NIR-based identification of drugs that may appear in various crystalline forms. Awareness on the existence of these forms and the consequences of library and data-model design to cope with this phenomenon will increase the robustness of on-site NIR-based drug detection.