O[C:2]1[CH:7]=[CH:6][N:5]2[N:8]=[CH:9][C:10]([C:11]([O:13][CH2:14][CH3:15])=[O:12])=[C:4]2[N:3]=1.P(Cl)(Cl)([Cl:18])=O>>[Cl:18][C:2]1[CH:7]=[CH:6][N:5]2[N:8]=[CH:9][C:10]([C:11]([O:13][CH2:14][CH3:15])=[O:12])=[C:4]2[N:3]=1Ethyl 5-hydroxypyrazolo[1,5-a]pyrimidine-3-carboxylate (22.7 g, 110 mmol) was suspended in phosphoryl trichloride (100 mL) and heated to reflux. After heating for 2 hours, the reaction mixture was cooled and concentrated to remove excess POCl3. The residue was diluted in DCM (100 mL) and slowly added to a flask containing ice water. The mixture was separated and the aqueous layer was extracted with DCM (2×200 mL). The combined organic layers were dried (MgSO4), filtered and concentrated to afford ethyl 5-chloropyrazolo[1,5-a]pyrimidine-3-carboxylate as a pale-yellow solid (24.2 g, 97.6% yield). MS (apci) m/z=225.9 (M+H).