An easy and efficient synthesis of the versatile, hitherto unreported alkyl 4-chloro-or 4-(alkoxycarbonylmethyl)amino(thio)-5-amino-2-methylthiothieno[2,3-d]-and pyrrolo[2,3d]pyrimidine-6-carboxylates 3,5,6,8, from 6-chloro-4-(alkoxycarbonylmethylamino)-2-methylthiopyrimidine-5-carbonitriles 2a,b is described. Reaction of 5-amino-4-chloropyrrolo[2,3-d]pyrimidine 6 with sarcosine methyl ester gave the novel 2,3,5,6,9-pentaazabenz[cd]azulene 7. Heating 5-amino-4-(ethoxycarbonylmethylthio)pyrrolo[2,3-d]pyrimidine 5 in DMSO in the presence of potassium carbonate afforded the first representative of 6-thia-2,3,5,9-tetraazabenz[cd]azulene 9. Reaction of 5-amino-4-(alkoxycarbonylmethylamino)thieno-and pyrrolopyrimidines 3 and 8 with ethyl orthoformate or formalin in the presence of acids furnished the new 1-thia-3,5,6,8-tetraaza-, 1,3,5,6,8-pentaazaacenaphthylenes 10a,b and their 3,4-dihydro derivatives 11a,b. Acylation of 3 and 8 with chloroacetyl chloride gave the 5-chloroacetylamino intermediates 12a,b, which on heating in DMF in the presence of potassium carbonate cyclised to give the 2-thia-3,5,6,8-tetraaza-and 2,3,5,6,9pentaazabenz[cd]azulene derivatives 13a,b.