The crystal structure of rimkorolgite, ideally Ba[Mg5(H2O)7(PO4)4](H2O), (monoclinic, P21/c, a = 8.3354(9), b = 12.8304(13), c = 18.313(2) Å, β = 90.025(2)°, V = 1958.5(4) Å3, Z = 4) has been solved by direct methods and refined to R1 = 0.052 using X-ray diffraction data collected from a crystal twinned on (001). There are five symmetrically independent Mg2+ cations that are each octahedrally coordinated by four O atoms and two H2O groups. One symmetrically independent Ba2+ cation is coordinated by eight O atoms and two H2O groups. The Mgϕ6 octahedra (ϕ = O, H2O) and PO4 tetrahedra form sheets parallel to (001). Their main elements are zigzag chains of the Mgϕ6 edge-sharing octahedra. The chains are linked via common vertices to form an octahedral sheet in which Mg atoms are located at the vertices of the 63 hexagonal net. The PO4 tetrahedra are above and below hexagonal rings of Mg octahedra and are linked to them by sharing common O vertices. The Ba atoms and H2O(1) and H2O(22) groups are located between the sheets providing their linkage into three-dimensional structure. The structure of rimkorolgite is closely related to that of bakhchisaraitsevite, Na2Mg5(PO4)47H2O. Both structures are based on the octahedral-tetrahedral sheets of the same type. In bakhchisaraitsevite, the sheets are linked into three-dimensional framework by edge-sharing between the Mgϕ6 octahedra from two adjacent sheets, whereas in rimkorolgite, there is no linkage between adjacent sheets. The structure of rimkorolgite can be considered as bakhchisaraitsevite-like framework interrupted by the presence of large Ba2+ cations.