Building on recent efforts to escape bailout entanglements, the Treasury Department revealed plans on Wednesday to unload its remaining 500 million common shares in General Motors (GM) within the next 15 months, but taxpayers may still lose money on the bailout.

As part of the agreement, GM said it will buy 200 million shares of its own common stock from the government for $27.50 each, amounting to a $5.5 billion buyback. That represents a 7.9% premium on GM’s close at $25.49 on Tuesday.

The U.S. said it plans to unload its remaining 300 million GM common shares on the open market within the next 12 to 15 months, beginning as soon as January and based on a pre-arranged written trading plan. That remaining chunk represents about 19% of the outstanding shares.

However, even if the U.S. receives $27.50 a share for its remaining shares, the government would be a little over $7 billion short of recouping the entire $49.5 billion bailout.

“This announcement is an important step in bringing closure to the successful auto industry rescue, it further removes the perception of government ownership of GM among customers, and it demonstrates confidence in GM’s progress and our future,” GM CEO Dan Akerson said in a statement.

The U.S. also said it has agreed to relinquish certain unspecified governance rights it received in exchange for the bailout, which came during the economic collapse of 2008 and 2009.

The Treasury Department said so far it has recovered more than $28.7 billion of its GM investment through repayments, sales of stock, dividends, interest and other income.

“The auto industry rescue helped save more than a million jobs during a severe economic crisis, but TARP was always meant to be a temporary, emergency program,” Timothy Massad, assistant Treasury secretary for financial stability, said in a separate statement. “The government should not be in the business of owning stakes in private companies for an indefinite period of time.”

GM said it expects to close the share buyback by the end of the year and sees the move adding to its earnings per share by cutting outstanding shares about 11%.

However, the auto maker also said it plans to take a charge of about $400 million in the fourth quarter on the buyback.

GM noted it was able to make the $5.5 billion buyback thanks to strengthening its balance sheet, which is projected to have liquidity of about $38 billion at the end of the year.

“We come to work every day grateful that taxpayers from the U.S. and Canada stepped forward to rescue our industry, and determined to show this extraordinary help was worth it,” Akerson said.

Shares of Detroit-based GM soared 6.92% to $27.25 Wednesday morning on the news, leaving them up 34.5% so far this year. 

The efforts to sell the government’s stake in GM come after the Treasury Department last week unloaded about $7.6 billion of shares in American International Group (AIG), exiting its common stock portfolio in the bailed-out insurer.

Also, earlier this week the U.S. said it plans to make significant progress in 2013 winding down the government’s TARP bank program.

The Treasury Department estimates it has recovered more than $381 billion, or 90%, of the $418 billion of TARP funds handed out.

Follow Matt Egan on Twitter @MattMEgan5