A novel and convenient strategy is described for the regioselective conversion of N,N′-disubstituted thioureas and 1,2-dielectrophiles into the highly biologically valuable 2-imino-thiazoline and 2-imino thiazolidine-4-one derivatives. The synthesis proceeds through a process with good yield promoted by an electrogenerated base (EGB) obtained with high current efficiency.