Magnesium hydroxyfluoride, Mg(OH)F, has been synthesized by a subcritical hydrothermal route from a 1:1 molar mixture of brucite, Mg(OH)2, and sellaite, MgF2 with a rutile type structure, in excess water. Using a combination of synchrotron X-ray and time-of-flight neutron powder diffraction, the structure of Mg(OH)F has been solved in the diaspore space group Pnma with a = 10.116(3), b = 4.6888(10) and c = 3.0794(7) Å at ambient conditions. The most intense diffraction lines are [dobs (hkl) Iobs]: 2.291 (211) 10, 4.253 (101) 7, 1.747 (212) 7, 2.229 (401) 6 and 1.480 (610) (4) Å, with the largest d-spacing at 5.058 Å. Sharp infrared stretching bands are located at 3679 and 3645 cm −1, with a broader band at 3535 cm −1. The topology of the structure is intermediate between that of the OH and F endmembers, being derived through notional shearing nearly normal to the sheets of octahedra of the CdI2/Mg(OH)2-type structure. Further similar shearing at an interval ½a would lead to a Cd(OH)F-type structure, which is also related to the rutile structure type. The observations and model presented here indicate a close correlation between the structural properties of the endmembers and Mg(OH)F.