The Daily Mail has formally apologized to Melania Trump for falsely claiming she once worked for an escort service, and it paid a lot of money to boot.

The First Lady settled her defamation lawsuit against the outlet ... reportedly for $2.9 million. She had sued for $150 million.

As part of the settlement, the Daily Mail had to publish a retraction, saying, "We accept that these allegations about Mrs. Trump are not true and we retract and withdraw them," adding, "We apologize to Mrs. Trump for any distress that our publication caused her."