In recent years, two adulteration incidents concerning the addition of melamine, a nitrogen-rich industrial small polar compound, to pet food and infant formula products have occurred in China. These issues prompted laboratories to develop methods for the analysis of melamine and related compounds in a wide variety of food products and ingredients. In this context, a CE-ESI-MS method was developed to simultaneously analyze melamine and its related products (ammeline, ammelide and cyanuric acid) that possess close physico-chemical properties. This method allows the simultaneous analysis of both cations and anions in a single run, using CE to divide the run into two time segments in normal polarity mode. For this purpose, ESI polarity was switched once during the run, increasing sensitivity and data quality. The method was applied to spiked powdered milk and melamine-contaminated powdered milk, with two sample preparation procedures.