The for-profit behemoth University of Phoenix will cancel millions of dollars in debt owed by students and pay restitution to resolve allegations of deceptive advertising, the Federal Trade Commission said Tuesday.

Phoenix must pay the FTC $50 million, which will be used to compensate former students. It must also forgo collection of about $141 million in debts owed directly to the school by people who attended between 2012 and 2016. Eligible borrowers will receive notification from the university, according to the commission.

“This is the largest settlement the Commission has obtained in a case against a for-profit school,” Andrew Smith, director of the FTC’s Bureau of Consumer Protection, said in a statement. “Students making important decisions about their education need the facts, not fantasy job opportunities that do not exist.”

Investigators say the University of Phoenix ran an advertising campaign that featured Microsoft, Twitter, Adobe and Yahoo, giving a false impression the school worked with those companies to employ its students. There was no such partnership, according to the FTC, a charge the university disputes. The commission also alleges the university falsely claimed it worked with a host of companies — including the American Red Cross, Rubbermaid and AT&T — to develop courses.

According to the complaint, the misleading marketing campaign targeted active-duty service members, veterans and military spouses. The university has been the largest recipient of post-9/11 GI Bill education benefits since the program’s inception more than a decade ago.

The University of Phoenix denies all wrongdoing and insists the school had relationships with the companies highlighted in the advertising campaign. University officials said they felt confident about the school’s ability to win in court but wanted to put the matter to rest.

“We continue to believe the University acted appropriately,” the company said in a statement. “This settlement will enable us to maintain focus on our core mission of improving the lives of students through career-relevant higher education, and to avoid any further distraction from serving students that could have resulted from protracted litigation.”

Tuesday’s settlement brings to a close a probe that began in 2015 and spawned other regulatory headaches for Phoenix. Shortly after the FTC began its inquiry, Apollo Education Group, which owns Phoenix, said the Defense Department was considering banning the university from participating in its tuition assistance program, citing the FTC investigation in addition to other government investigations.

About the same time, the Defense Department suspended the for-profit college from recruiting on military bases and placed a six-month moratorium on access to education funding dedicated to service members. The decision stemmed from allegations that the university sponsored recruiting events in violation of an executive order preventing for-profit colleges from gaining preferential access to the military.

Veterans groups have criticized federal agencies for not doing enough to keep education benefits out of the hands of colleges that they say prey on members of the military. This year, three dozen advocacy groups urged Veterans Affairs Secretary Robert Wilkie to intensify monitoring of college programs that enroll veterans after an audit found lax oversight could result in $2.3 billion in tuition benefits going to predatory schools during the next five years.

“Enough is enough. It’s time to stop the fleecing of America’s veterans and service members by predatory colleges,” said Carrie Wofford, president of Veterans Education Success, an advocacy group. “We thank the FTC for its leadership and call on VA and the Defense Department to protect veterans and service members.”

During the FTC investigation, the advocacy group connected the commission with half a dozen whistleblowers who served as recruiters for Phoenix. Wofford said the FTC settlement puts pressure on VA to enforce federal law requiring the agency to cut off GI Bill funds to schools that engage in deceptive and misleading recruiting and advertising. VA did not immediately respond to a request for comment Tuesday.

Education funding earned by men and women who serve in the U.S. military has become a stable source of revenue for many colleges — especially for-profit schools. The aggressive recruiting practices of some for-profit colleges have been well-documented. A 2012 Senate investigation found evidence of schools deploying teams at veterans hospitals and Wounded Warrior centers to enroll students. Some recruiters misled or lied to veterans in telling them that their military benefits cover the full cost of tuition.