How do you turn a for-profit college into a nonprofit? Partner with a public university – and pay $50 million for the privilege.

That’s basically what happened last week in a financial deal between the for-profit Kaplan higher-education chain and Purdue University, the flagship Indiana college run by Mitch Daniels, the state’s former governor.

The arrangement may help Kaplan parent Graham Holdings shed the for-profit education sector’s tarnished reputation. Purdue – paying Graham only a symbolic $1 – immediately enters the ranks of public universities expanding their reach with online degrees targeting older Americans – many of them minorities – who are unable to attend traditional schools.

“We thought it would be a bad idea for us to build this on our own,” said Daniels, Purdue’s president. “We’ve seen a lot of schools throw a lot of money at online education without much result.”

Under the contract, Graham will transfer Kaplan University’s online programs, as well as its 15 campuses and learning centers – with 32,000 students – to the Purdue-related nonprofit. Kaplan will then operate them and guarantee that Purdue’s venture, for five years, receives at least $10 million a year from Kaplan’s revenues after expenses.

After that payment, Kaplan is entitled to reimbursement for its own cost of providing services, plus a fee equal to 12.5 percent of the Purdue affiliate’s revenues.

Kaplan Higher Education reported $617 million in revenue last year and almost $67 million in operating income. It has three campuses in Maine, in South Portland, Lewiston and Augusta.

Kaplan was once the crown jewel of Washington Post Co., as its fast-growing colleges helped support its financially struggling newspaper. In 2013, the company sold the Post to Amazon.com founder Jeff Bezos and then changed the name of the company to Graham Holdings, after the Washington family that had long controlled the paper. Donald Graham, then the Post Co. chief executive officer, is still the Graham Holdings chairman.

For-profit colleges, including Kaplan, have seen their fortunes dim amid scrutiny from Congress and state and federal authorities over their aggressive marketing, high cost and job placement claims. (Kaplan lists several government investigations and lawsuits in its most recent annual securities filing.) These institutions’ revenue comes mostly from federal loans, and they have long had higher loan default rates than conventional schools.

Online offerings from public universities – including Arizona State University, which has a partnership with Starbucks to offer degrees to its employees – have also proved to be stiff competition for for-profits.

Converting to a nonprofit structure will burnish Kaplan’s reputation because it has been “operating under a terrible cloud” as part of the for-profit sector, said Trace Urdan, an analyst who recently left Credit Suisse.

Since the election of Donald Trump, who promised on the campaign trail to reduce government involvement in education, shares of publicly traded companies in the industry have surged. While the Standard & Poor’s 500 Index has gained 13 percent since the Nov. 7 election, Graham Holdings shares are up 35 percent.

Trump’s own for-profit school, Trump University, paid $25 million in November to settle a lawsuit alleging that the real-estate seminar firm defrauded its customers and that it illegally called itself a university.

Several for-profit universities have entered into arrangements like Kaplan’s, which enable them to benefit from the tax advantages of a nonprofit company. Critics, including members of Congress and Bob Shireman, a former deputy undersecretary of education in former President Barack Obama’s administration, have said these conversions can amount to abuses of the federal tax code and also help operators avoid the regulatory crackdown on for-profit colleges.

“To me, that’s Kaplan buying the Purdue name to run their college,” said Shireman, now a senior fellow at the Century Foundation, a New York-based think tank.

Purdue’s Daniels said he had looked carefully at Kaplan’s background and it had “by far the best record we would could find in the industry.” He added: “As soon as I learned Kaplan was looking to exit the for-profit space, I quickly centered on them.”

Daniels stressed that “the academics will be under our guidance,” while Kaplan will provide “back-office services,” including recruiting and marketing. Kaplan’s 3,000 academic staff will join the new university under the Purdue umbrella. (The deal doesn’t include Kaplan’s test-prep unit.)

In a written statement, Graham said Kaplan and Purdue “share the critical mission of expanding access to education.”