WASHINGTON — Six years after President George W. Bush began the auto bailout, the Obama administration on Friday declared a profitable end to the sweeping federal interventions in Wall Street and Detroit, saying a final sale of stock from General Motors’ former finance arm had closed a turbulent chapter of the financial crisis.

The programs “that helped restart the flow of credit to meet the critical needs of small businesses and consumers are now closed,” declared Treasury Secretary Jacob J. Lew. “And while the goal was always to stabilize the economy, and not to make a profit, it is important to recognize the return we have earned for taxpayers.”

The government actions, initially seen as necessary in Washington and on Wall Street to prevent a collapse of the economy on the order of the Great Depression, agitated the political world, helping give rise to the Tea Party movement on the right and the Occupy Wall Street movement on the left. And even as the nation climbed out of recession and slowly recovered, many Americans were left with little trust in the nation’s government and financial institutions.

Tea Party, to many of its foot soldiers, stood for Taxed Enough Already, and the bailouts were assumed to be enormous drains on the federal Treasury. Yet in the end, the Troubled Asset Relief Program and the Detroit bailout yielded $15.35 billion in profit, Treasury officials said Friday.