An unusual rearrangement following cyclization of 2-anilino-2-ethoxy-3-oxothiobutanoic acid with aliphatic 1,3- as well as 1,4-diamine leads to zwitterionic derivatives of 2-hydroxypropanoic acid. Moreover, with aromatic 1,2-diamines, fused heterocyclic systems such as pteridine, quinoxaline, and pyrido[2,3-b]pyrazine are obtained.