The invention provides a method for the preparation of a dicarbonyl compound of formula (I) R1COCFR2COR3 wherein R1 is selected from alkyl, substituted alkyl, cycloalkyl, aryl, substituted aryl and acetoxy, R2 is selected from hydrogen, halogen, nitro, cyano, alkyl, substituted alkyl, cycloalkyl, acetoxy, aryl and substituted aryl, and R3 is selected from alkyl, substitued alkyl, oxyalkyl and substituted oxyalkyl, the method comprising treating a dicarbonyl compound of formula (II) R1COCHR2COR3 with elemental fluorine in a solvent which consists of methanol or aqueous methanol. The method provides an inexpensive and convenient synthetic route to 2-fluoro- and 2,2-difluoro-1,3-diketones and -1,3-ketoesters.