A method of producing a magnesium fluoride coating includes a step of forming a coating by applying a solution containing a fluorine-containing organic magnesium compound represented by the following formula to a base and a step of heat-treating the coating while the coating is being irradiated with a beam of light with a wavelength of 246 nm or less:
Mg(CF3—X—COO)2 (1)
wherein X represents a single bond or one of —(CF2)n—, —(CH2)m—, and —CH2CF2— that may have a substituent, where n and m each represent an integer of 1 to 4. The temperature of the heat-treating step can be 250° C. or lower. The coating can be irradiated with a beam of light with a wavelength of 185 nm or less.