The origin of the Martian moons, Phobos and Deimos, remains elusive. While the morphology and their cratered surfaces suggest an asteroidal origin1-3, capture has been questioned because of potential dynamical difficulties in achieving the current near-circular, near-equatorial orbits4,5. To circumvent this, in situ formation models have been proposed as alternatives6-9. Yet, explaining the present location of the moons on opposite sides of the synchronous radius, their small sizes and apparent compositional differences with Mars2 has proved challenging. Here, we combine geophysical and tidal-evolution modelling of a Mars-satellite system to propose that Phobos and Deimos originated from disintegration of a common progenitor that was possibly formed in situ. We show that tidal dissipation within a Mars-satellite system, enhanced by the physical libration of the satellite, circularizes the post-disrupted eccentric orbits in <2.7 Gyr and makes Phobos descend to its present orbit from its point of origin close to or above the synchronous orbit. Our estimate for Phobos's maximal tidal lifetime is considerably less than the age of Mars, indicating that it is unlikely to have originated alongside Mars. Deimos initially moved inwards, but never transcended the co-rotation radius because of insufficient eccentricity and therefore insufficient tidal dissipation. Whereas Deimos is very slowly receding from Mars, Phobos will continue to spiral towards and either impact with Mars or become tidally disrupted on reaching the Roche limit in ≲39 Myr.