The present invention provides a method capable of more simply and efficiently producing halogen-containing pyrazolecarboxylic acids and intermediates thereof, which are useful as pharmaceutical or agrochemical intermediates, in a manner suitable for industrial production.The present invention relates to a method of producing a compound represented by the formula (b), which comprises reacting a compound represented by the formula (a) with a halogenating agent selected from the group consisting of a compound represented by X2 (formula (1)), a compound represented by SOX2 (formula (2)), and a compound represented by SO2X2 (formula (3)) to obtain the compound represented by the formula (b): formula (1) X2 formula (2) SOX2 formula (3) SO2X2wherein each symbol is as described in the description.