The cyclization of 5-aminopyrazole (I) with ethyl acetoacetate (II) by means of p-tolulenesulfonic acid in refluxing toluene gives the pyrazolo-pyrimidinone (III), along with its undesired isomer that is separated by crystallization or chromatography. The reaction of (III) with POCl3 gives the chloro derivative (IV), which is finally condensed with butylethylamine (V).