Two ways of cyclization of imidazolyl derivatives of thiourea with dimethylacetylene dicarboxylate (DMAD) were studied. Reaction of N,N'-disubstituted thioureas with DMAD led to formation of a thiazoline ring whereas transformation of trisubstituted thioureas under the same conditions give the novel imidazo[1,5-c][1,3,5]thiadiazine heterocyclic system.