Gawker has reached a settlement with Hulk Hogan, bringing to an end the legal battle that led to the demise of Gawker.com.

The company will pay $31 million to settle the lawsuit and contribute proceeds from its $135 million sale to Univision, according to news reports. That's instead of the $140 million judgment that drove the company into bankruptcy earlier this year.

Gawker founder Nick Denton announced the settlement in a blog post Wednesday.

"Yes, we were confident the appeals court would reduce or eliminate the runaway Florida judgment against Gawker, the writer of the Hogan story and myself personally. And we expected to prevail in those other two lawsuits by clients of Charles Harder, the lawyer backed by Peter Thiel," Denton wrote.

"But all-out legal war with Thiel would have cost too much, and hurt too many people, and there was no end in sight. The Valley billionaire, famously relentless, had committed publicly to support Hulk Hogan beyond the appeal and 'until his final victory.' Gawker’s nemesis was not going away."

Hogan sued Gawker over a 2012 post that featured a clip of a tape that showed the professional wrestler having sex with the wife of a friend of Hogan. His legal battle was funded by Peter Thiel, the billionaire PayPal founder and Facebook investor.

David Houston, a lawyer for Hogan, said in an emailed statement: "As with any negotiation for resolution, all parties have agreed it is time to move on."

Many had expected that the $140 million judgment that drove Gawker into bankruptcy and forced the media company to auction itself off to Univision would be overturned on appeal.

Instead, Gawker is opting to end this fight now. The settlement will also clear Denton and former Gawker editor A.J. Daulerio of personal debts imposed by the Florida jury's judgment.

Denton said in his post that the legal fight represented less than 1 percent of Thiel's net worth, compared to the consequences for Gawker's employees named in the suit.

As part of the settlement, Gawker will remove three stories from its site: The post involving Hogan, a story about a claim by Shiva Ayyadurai that he invented email and a story about a feud between the founders of Tinder. Those stories were also under litigation backed by Thiel's lawyer.

The settlement will have to be approved by a bankruptcy court.

"It’s a shame the Hogan trial took place without the motives of the plaintiff’s backer being known," Denton wrote of Thiel. "If there is a lasting legacy from this experience, it should be a new awareness of the danger of dark money in litigation finance. And that’s surely in the spirit of the transparency Gawker was founded to promote. As for Peter Thiel himself, he is now for a wider group of people to contemplate."

Can we relaunch Gawker now — Hamilton Nolan (@hamiltonnolan) November 2, 2016