Water treatment for most public pools involves disinfection with active chlorine leading to the formation of disinfection by-products (DBPs). Among them, nitrogen-containing compounds (N-DBPs) having increased toxicity and adverse effects on human health are of the greatest concern. Being the major component of various body washers for swimmers, cocamidopropyl betaine (CAPB) represents a potential and still underestimated anthropogenic precursor of N-DBPs in pool water. The purpose of this study was to investigate CAPB transformation pathways and mechanisms under the aqueous chlorination conditions. High-performance liquid and two-dimensional gas chromatography hyphenated with high-resolution mass spectrometry were used for the search and tentative identification of the primary and final CAPB transformation products. A wide range of DBPs containing up to five chlorine atoms including these in combination with hydroxyl and additional carbonyl groups has been revealed in model chlorination experiments for the first time. The proposed mechanism of their formation involves nucleophilic substitution of the secondary amide hydrogen atom at the first stage with subsequent free radical and electrophilic addition reactions resulting in non-selective introduction of halogen atoms and hydroxyl groups in the alkyl chain. The deep transformation products include short-chain chlorinated hydrocarbons and their oxidation products as well as dimethylcarbamoyl chloride possessing high toxicity and carcinogenic properties. Targeted analysis of real swimming pool water samples confirmed the results of model experiments enabling semi-quantitative determination of CAPB (0.8µg L-1) and 18 primary DBPs, including 10 chlorine-containing compounds with the total concentration of 0.1µg L-1. Among them, monochloro (50%) and hydroxydichloro (25%) derivatives predominate. The toxicity and health of the main DBPs has been estimated using QSAR/QSTR approach. Thus, the possibility of formation of new classes of potentially toxic chlorine-containing DBPs associated with the widespread use of detergents and cosmetics was shown.