The Obama administration has turned the page on one of the most controversial chapters of the 2008 financial crisis: the auto bailouts.

On Friday, the Treasury Department said it sold its remaining stake in auto lender Ally Financial, the last major recipient of federal funds through the Troubled Assets Relief Program and the Auto Industry Financing Program. The department said it turned a $2.4 billion profit on the $17.2 billion investment in the company formerly known as GMAC.

“This marks another major milestone in Ally’s journey,” Michael Carpenter, chief executive of Ally, said in a statement. “We are appreciative of the investment the U.S. Treasury made in Ally and their understanding of how important available financing was to the U.S. auto recovery.”

Stepping in to save the auto industry six years ago exposed the government to endless criticism. Congress begrudgingly agreed to open Treasury’s $700 billion financial rescue program to the auto industry as a sharp decline in car sales crippled manufacturers and lenders.

“The Auto Industry Financing Program helped save the auto industry, more than one million jobs and prevent a second Great Depression,” Treasury Secretary Jacob J. Lew said in a statement.

Six years later, what’s become of the auto industry that American taxpayers saved?

It’s doing quite well. Sales are up as the U.S. economy improves and consumers have easy access to credit. New vehicle sales have risen 6 percent this year and automakers are on track to sell at least 16.4 million vehicles, the most since 2006.

GM, once pilloried as “Government Motors,” saw its profits double in the most recent quarter compared to a year ago. This despite the recalls over faulty ignition switches in its cars. The company increasingly has its eyes fixed overseas, particularly in China, for growth.

Chrysler, another major beneficiary of the auto bailout, isn’t even called Chrysler anymore. The company merged with Fiat in 2009 to become a new company incorporated in the Netherlands called FCA N.V. This week, the Chrysler Group, which is now the U.S. unit of FCA, said it’s changing its name to FCA US.

But there are also allegations casting a cloud over the industry that lenders are cutting corners to get more borrowers with poor credit histories into driver’s seats. And there are other concerns about lending practices.

The Consumer Financial Protection Bureau recently slapped Ally with a $98 million penalty for allegedly charging minority borrowers higher interest rates than whites. It was the government’s largest-ever auto-loan discrimination settlement.

Ally said Thursday that the Justice Department has requested information about its subprime auto lending practices. Federal prosecutors have in recent months launched investigations into the subprime underwriting standards and securitization at the financing arm of General Motors and the consumer-lending unit of Spain’s Santander.

In the years since the downturn, Ally has also been mired in litigation tied to its former mortgage subsidiary, Residential Capital (ResCap), making it difficult for Ally to repay the government. It was released from ResCap’s legal liabilities last December, when a judge approved the mortgage firm’s bankruptcy plan.

Still, Ally has rebounded since its bailout days when it lost $2.1 billion in 2008.

It went public earlier this year in an initial public offering that raised $2.3 billion. Ally reported net earnings totaling more than $3.6 billion in the third quarter. Auto loan originations in the third quarter were $11.8 billion, up from $9.6 billion the same period a year earlier.

Treasury slowly sold off its shares in Ally. In the latest round, the department generated $1.3 billion from the sale of 54.9 million shares of the company. Ally’s exit leaves Treasury with less than $1 billion invested in 35 community banks, far fewer than the 700 that participated at the height of the program. As it stands, the department has recovered $441.7 billion for taxpayers on its investments in TARP, compared to the $426.4 billion it spent.