Novel pyrazolo[1,5-a] pyrimidines (9a, 9b, and 10a-c) were synthesized in high and efficient yields. Their pathway involves the formation of N, S-ketene derivatives (7a and 7b) that reacted with hydrazine hydrate to get the key intermediate aminopyrazolo derivatives (8a and 8b). These aminopyrazoles were further reacted with either acetylacetoneor beta-ketoesters resulting in the targeted pyrazolopyrimidines (9a, 9b, and 10a-c). All prepared compounds were fully characterized by spectral methods and the cyclization of 10a-d was proved by 2D NMR such as HMBC, HSQC and NOESY. The targeted pyrazolopyrimidines were subjected to in vitro anticancer screening and all of them showed promising cytotoxic activity when compared to doxorubicin. Compound 10d was the most active with IC50= 1.98, 2.20 and 2.61 mu M against MCF-7, BT474 and A549 cancer cell lines.