The reactions of N-benzoyl-N′-(o-cyanoaryl)thioureas with ethyl bromoacetate under alkaline conditions led to the formation of either fused 2-(alkylsulfanyl)-4-aminopyrimidines or 2-(benzoylimino)-3-(o-cyanoaryl)thiazolidin-4-ones. The accurate application of slightly different reaction conditions allowed us to adjust the balance between the formation of the pyrimidine or thiazolidine heterocycles. Atropisomerism in the 3-(o-cyanoaryl)thiazolidin-4-ones was influenced by the size of the o-cyanoaryl ring, which was investigated by means of NMR measurements and theoretical calculations.