Melania Trump has won a “substantial” amount of money in a settlement with Maryland blogger who wrote about claims that she had once worked as a prostitute.

“The First Lady of the United States has settled her lawsuit against Webster Griffin Tarpley of Maryland,” said Matthew Blackett, one of Mrs. Trump’s attorneys.

“Mr. Tarpley has issued the attached retraction and apology to Mrs. Trump and her family, and agreed to pay her a substantial sum as a settlement,” Blackett said in a statement.

Blackett also provided The Post with a copy of the 71-year-old Gaithersburg, MD, resident’s apology.

“I posted an article on August 2, 2016 about Melania Trump that was replete with false and defamatory statements about her. I had no legitimate factual basis to make these false statements and I fully retract them,” it reads.

Tarpley did not return messages about the settlement, but his attorney confirmed the agreement.

The mea culpa continues, “I acknowledge that these false statements were very harmful and hurtful to Mrs. Trump and her family, and therefore I sincerely apologize to Mrs. Trump, her son, her husband and her parents for making these false statements.”

The deal was reached a day after Mrs. Trump sued the Mail Online in New York Supreme Court over a similar claims that she once worked as a high-priced call girl in the 1990s before marrying her husband.

The New York suit was the third against the Mail Online. Mrs. Trump had originally listed the publication as a co-defendant in the Maryland suit, but the judge removed the Mail for jurisdictional reasons. There’s also a pending case in the U.K. over an article in the publication’s print version.

Mrs. Trump’s lawyers made a new, eyebrow-raising claim in the New York suit — that the prostitution rumors ruined her “once-in-a-lifetime opportunity” to cash in on the presidency.

The suit says the First Lady “had the unique, once-in-a-lifetime opportunity, as an extremely famous and well-known person…to launch a broad-based commercial brand in multiple product categories, each of which could have garnered multi-million dollar business relationships for a multi-year term during which plaintiff is one of the most photographed women in the world.”

“These product categories would have included, among other things, apparel, accessories, shoes, jewelry, cosmetics, hair care, skin care and fragrance,” according to the filing.

It places the value of the lost business opportunities at $150 million.

A spokeswoman for Mrs. Trump seemed to walk back the claims made in court papers.

“The First Lady has no intention of using her position for profit and will not do so. Any statements to the contrary are being misinterpreted,” the spokeswoman said.