General Motors Co. will purchase 200 million shares of its stock from the U.S. Treasury as part of the department’s plan to sell its entire holding of GM stock within 15 months.

The $5.5 billion transaction, at $27.50 a share, represents a 7.9 percent premium and will close by the end of the year, GM said. Treasury plans to begin selling its remaining shares as soon as January, the company said. The sale represents 40 percent of the government’s remaining stake after the 2009 bailout and 2010 initial public offering.

The bailouts of GM and Chrysler Group LLC by U.S. and Canadian governments propped up an industry that has since reported three straight years of at least 10 percent growth. GM received $51 billion from the U.S. Treasury as part of its restructuring. Taxpayers still owned 32 percent of the company before today. Cutting the stake could be good for GM’s image and its stock.

“It’s going to materially lift an overhang that’s been over the stock,” Peter Nesvold, a Jefferies & Co. analyst in New York, said in a phone interview. “There’s been this nagging fear anytime the stock gets closer to $27 or $28 where the chatter about the government sell down picks up again.”

GM rose 2.6 percent Tuesday to $25.49. The shares have gained 26 percent this year. Tuesday’s closing level was 23 percent lower than the company’s IPO price of $33 a share. The shares gained 9.1 percent to $27.80 at 9:11 a.m. New York time before the start of regular trading.

GM said it expects to record $400 million in costs this quarter because of the transaction.

The “Government Motors” tag stemming from the 2009 bailout dogged GM throughout this year’s U.S. presidential campaign. President Barack Obama defended the bailout as he campaigned for re-election. Republican candidates, including nominee Mitt Romney, had criticized it.

For the automaker, the transaction is a way to move past the political controversies.

“It’s obviously good for the business in terms of continuing to remove the perception of government involvement in the company which is going to be good for sales,” Chief financial officer Dan Ammann told reporters Wednesday in Detroit. “This is very attractive to the company, to our shareholders. It obviously brings some clarity and certainty to the U.S. Treasury exit.”

The Treasury Department, in a statement, said it was time to exit the GM stake.

“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, an assistant secretary, said in the statement. “The government should not be in the business of owning stakes in private companies for an indefinite period of time.”

The Treasury last week sold its last 234.2 million shares of insurer American International Group Inc., marking the end of the rescue more than four years after the U.S. took over the company to save the global economy. Proceeds from the sale boosted the U.S. profit on the AIG bailout to $22.7 billion.

The Congressional Budget Office estimated in October that the Treasury’s Troubled Asset Relief Program, which bailed out companies including AIG, Citigroup Inc. and GM, will cost taxpayers $24 billion, down from an estimate of $109 billion in March 2010.