Synchrotron X-ray diffraction patterns were measured and analyzed for a polycrystalline sample of the room-temperature ferromagnet Sr3.12Er0.88Co4O10.5 from 300 to 650 K, from which two structural phase transitions were found to occur successively. The higher-temperature transition at 509 K is driven by ordering of the oxygen vacancies, which is closely related to the metallic state at high temperatures. The lower-temperature transition at 360 K is of first order, at which the ferromagnetic state suddenly appears with exhibiting a jump in magnetization and resistivity. Based on the refined structure, possible spin and orbital models for the magnetic order are proposed.