Donald Trump has agreed to pay $25 million to settle three lawsuits against Trump University.
The deal will keep the president-elect from having to testify in a trial in San Diego that was set to begin November 28.
The settlement ends a suit brought by New York Attorney General Eric Schneiderman, as well as two class action suits in California.
About 6,000 former students are covered by the settlement. The victims will receive at least half of their money back, said plaintiff attorney Jason Forge at a court hearing Friday.
About $21 million will go to settle the class-action suits and $4 million will cover the victims of the suit brought by Schneiderman, Forge said. The attorneys waived all fees.
"We are pleased to announce the complete resolution of all litigation involving Trump University," a Trump Organization spokesperson said.
"While we have no doubt that Trump University would have prevailed at trial based on the merits of this case, resolution of these matters allows President-Elect Trump to devote his full attention to the important issues facing our great nation."
On Saturday morning, Trump tweeted he settled the lawsuit for a "small fraction" because he wants to focus on the task at hand.
Trump University is the defunct, for-profit real estate seminar business Trump created in 2005. It promised to teach students investing techniques they could use to get rich on real estate, just like Trump.
It advertised that instructors were hand-picked by the mogul himself, but former students claimed that wasn't true. In fact, Trump has suggested under oath that he was not very involved in hiring instructors, despite what the promotional materials suggested.
Some students ended up paying tens of thousands of dollars. While the initial Trump University seminar was free, teachers would then upsell them for another program. A "one year apprenticeship," which was effectively a three-day seminar, cost $1,495, according to court documents. A "mentorship" cost at least $10,000 and the most expensive, the Gold Elite program, cost $35,000.
The settlement is a complete turnaround from Trump's earlier position on the lawsuits.
"This is a case I could have settled very easily, but I don't settle cases very easily when I'm right," he said in March.
But since Trump was elected, U.S. District Judge Gonzalo Curiel urged the parties to settle the case to avoid the immense complications of a president-elect facing trial while preparing to take office.
Last week, one of Trump's attorneys indicated that he might change his position on settling.
Schneiderman said Friday that he was pleased with the terms of the settlement. He first filed the suit in 2013.
"The victims of Trump University have waited years for today's result and I am pleased that their patience -- and persistence -- will be rewarded by this $25 million settlement," he said in a statement.
CNN's Paul Vercammen contributed to this story.