A method for synthesizing N-trifluoromethylazole derivatives has been developed via the reaction of their sodium salts with dibromodifluoromethane and substitution of bromine by fluorine. The first ionic liquids with a trifluoromethyl group on an imidazole nitrogen atom have been synthesized.