The Treasury Department said on Thursday that it expects to sell its remaining shares of General Motors Company (NYSE:GM) by the end of the year. The announcement underscores the recovery of the U.S. auto industry after the government funded a $50 billion rescue of the Detroit automaker.

The government has already sold 70.2 million GM shares, and it will continue selling its remaining 31.1 million shares at existing average daily trading volumes, although that schedule remains subject to market conditions. So far, the government has recovered $38.4 billion of its $49.5 billion investment, and at current prices, the total recovery is expected to be $39.6 billion. Under the current plan to exit its GM investment, U.S.  taxpayers are likely to be left with a loss of about $10 billion.

“Treasury’s investment in the American auto industry was part of President Obama’s broader response to the financial crisis, and it helped save more than one million jobs,” Treasury Deputy Assistant Secretary Tim Bowler said.

The government bailouts that were part of the Troubled Asset Relief Program resurrected GM and Chrysler Group LLC, as U.S. auto sales rose 8.4 percent through October, on track to hit 15.5 million by the end of 2013, compared to 10.4 million auto sales in 2009, according to Reuters.

“Had we not acted to support the automotive industry, the cost to the country would have been substantial -- in terms of lost jobs, lost tax revenue, reduced economic production and other consequences,” Bowler said. “Our actions have enabled the industry to rebound. All three American automakers are now profitable, and more than 340,000 new auto jobs have been created since GM and Chrysler emerged from bankruptcy in 2009.”

The Obama administration has been keen to exit its investments in the private sector as soon as possible, but without passing on losses to taxpayers. According to an earlier estimate, GM's exit was expected in April 2014.

“While the U.S. Treasury’s equity stake draws to a close, our work to transform GM continues,” GM said in a statement on its website. The statement was made in response to the Treasury’s announcement. “We’re making great progress in our efforts to make the most of this second chance by building outstanding cars and trucks, creating jobs and reinvesting in our country.”

GM shares rose 1.14 percent to reach $38.12 at close on the New York Stock Exchange on Thursday.