Hydrazonyl bromides 2a,b reacted with active methylene compounds (dibenzoylmethane, acetylacetone, ethyl acetoacetate, phenacyl cyanide, acetoacetanilide, ethyl cyanoacetate, cyanoacetamide and malononitrile) to afford the corresponding 1,3,4,5- tetrasubstituted pyrazole derivatives 5-12a,b. Reaction of 12a,b with formamide, formic acid and triethyl orthoformate give the pyrazolo[3,4-d]pyrimidine, pyrazolo[3,4- d]pyrimidin-4(3H)one and 5-ethoxymethylene-aminopyrazole-4-carbo-nitrile derivatives 13-15a,b, respectively. Compounds 15 a,b reacted with benzhydrazide and hydrazine hydrate to afford pyrazolo[4,3-e][1,2,4]triazolo[1,5-c]pyrimidine and [4-iminopyrazolo- [3,4-d]pyrimidin-5-yl]amine derivatives 16 a,b and 17 a,b. Reactions of compounds 17 a,b with triethyl orthoformate and carbon disulfide give the corresponding pyrazolo[4,3-e]- [1,2,4]triazolo[1,5-c]pyrimidine derivatives 18a,b and 19 a,b, respectively.