For more than six years, Donald Trump fought hard against a lawsuit in which former customers of his now-defunct Trump University accused him of fraud.
Less than two weeks after being elected president, he agreed to a $25 million settlement.
"We definitely detected a change of tone and change of approach" after the election, plaintiffs' attorney Jason Forge said when the agreement was announced Friday.
About 7,000 students would be eligible for refunds if U.S. District Judge Gonzalo Curiel approves the settlement.
Under the terms, the Republican president-elect admits no wrongdoing in settling two federal class-action lawsuits in San Diego and a lawsuit brought by New York Attorney General Eric Schneiderman, a Democrat.
The agreement came 10 days before jury selection was scheduled to begin in San Diego in the oldest case, which was filed in April 2010. The complaint accused Trump University, which wasn't an accredited school, of defrauding students who paid up to $35,000 a year to enrol in programs that promised to share Trump's real estate secrets.
Trump denied the allegations and said during the campaign that he would not settle.
He told supporters at a May rally that he would come to San Diego to testify after winning the presidency.
"I could have settled this case numerous times, but I don't want to settle cases when we're right. I don't believe in it. And when you start settling cases, you know what happens? Everybody sues you because you get known as a settler. One thing about me, I am not known as a settler," Trump said at the time.
Two days after the election, Trump's lead attorney in the San Diego cases, Daniel Petrocelli, said he was "all ears" to settlement talks and accepted an offer to have U.S. District Judge Jeffrey Miller of San Diego broker negotiations.
Forge said the agreement was reached an hour before a hearing for Curiel to weigh Trump's latest request to delay the trial until after the Jan. 20 inauguration. The plaintiffs' attorney said Miller's role as a mediator was "very critical."
"We were at each other's throat for 6 1/2 years and were able to find the common ground with them and do something good there," Forge told reporters.
The agreement cancelled the trial and lifted what would probably have been a major headache for Trump as he works to fill key executive branch positions and get acquainted with foreign leaders.
The trial was expected to last several weeks, guaranteeing daily news coverage of a controversy that dogged him during the campaign.
Trump's political rivals seized on the lawsuits to try to portray him as dishonest and deceitful. Trump brought more attention to them by repeatedly assailing Curiel, who oversaw the San Diego cases.
Trump suggested the Indiana-born judge's Mexican heritage exposed a bias.
The thousands of former students covered by the San Diego lawsuits will be eligible to receive at least half and possibly all their money back, as much as $35,000, Forge said. The plaintiffs' attorneys waived their fees.
Schneiderman called the agreement a "stunning reversal" for the president-elect, saying Trump "fought us every step of the way, filing baseless charges and fruitless appeals and refusing to settle for even modest amounts of compensation for the victims of his phoney university. Today, that all changes."
Trump's attorneys said the settlement allows the president-elect to focus full attention on his transition to the White House.
"He was willing to sacrifice his personal interests, put this behind him, and move forward," Petrocelli said.
Alan Garten, the Trump Organization's general counsel, said he had "no doubt" Trump would have prevailed at trial.
The lawsuits allege that Trump University gave nationwide seminars that were like infomercials, constantly pressuring people to spend more and, in the end, failing to deliver on its promises.
The San Diego trial would have been pinned on whether a jury believed Trump misled customers by calling the business a university and by advertising that he hand-picked instructors.
Court documents unsealed in May revealed strategies for enticing people to enrol even if they couldn't afford it. The documents outlined how employees should guide people through "the roller coaster of emotions" after they express interest and told employees to be "very aggressive during these conversations to in order to push them out of their comfort zones."
Transcripts of about 10 hours of Trump depositions provided additional material to rivals, though Curiel denied a request to release video of Trump's testimony that would have likely been used in campaign attack ads.
Trump acknowledged in the depositions that he played on people's fantasies, and he could not recall names of his employees despite his advertising pitch that he hand-picked them.
Trump has repeatedly claimed a 98 per cent customer satisfaction rate on internal surveys.
Plaintiffs countered that students were asked to rate the product when they believed they still had more instruction to come and were reluctant to openly criticize their teachers on surveys that were not anonymous.
The settlement came a day after watchdog groups and ethics experts who served in both Republican and Democratic administrations sent a letter to Trump urging him to make a clean break from his business to avoid "embroiling the presidency in litigation."
One of the authors, Richard Painter, an ethics lawyer at the White House under Republican President George W. Bush, said the Trump University settlement might backfire if lawyers think Trump is eager to settle to avoid court cases while president.
"The plaintiffs' lawyers," he said, "are going to smell blood in the water."