A facile one‐pot microwave‐assisted synthesis of pyrazolopyrimidines and pyrazolothiazoles was developed by reacting 5‐amino‐4‐thiocyanato‐pyrazoles with Vilsmeier Reagent (PBr3/foramide). The reaction gave the corresponding pyrazolopyrimidines as major products in good yields (61–85 %) and pyrazolothiazoles as minor products (11–23 % yields). The plausible reaction mechanism was proposed to account for the transformation of pyrazolopyrimidines and pyrazolothiazoles through two paths A and B. In path A, the reaction leading to the formation of pyrazolopyrimidines proceeded through four sequential steps, including acidic catalyzed cascade dethiocyanation/cyclization, Vilsmeier reaction, ring expansion, and deamination. The formation of the pyrazolothiazole in path B was caused by the nucleophilic heterocyclization reaction involving the sulfur nucleophilic reaction of thiocyanate (R−SC≡N) and the departure of a cyanamide. Based on the experimental results, we observed that the path A for the formation of pyrazolopyrimidines was more favorable.