General Motors is zooming back into the S&P 500.

S&P said Monday that the automaker will replace H.J. Heinz Co. (HNZ) in its index after the close of trading on Thursday. Heinz is set to go private after announcing earlier this year that it had agreed to be purchased for $28 billion by a consortium including Warren Buffett's Berkshire Hathaway (BRKA) and private equity firm 3G Capital.

The automaker was bounced from the S&P 500 around the time of its 2009 bankruptcy filing and $50 billion government bailout. It returned to the New York Stock Exchange in 2010 and reported $1.1 billion in first-quarter earnings last month.

S&P's announcement is likely to be welcomed by the Treasury Department, which is in the process of selling off the GM shares it acquired as part of the bailout. As a result of Monday's news, managers of index funds tied to the S&P 500 will have to buy GM shares, a development likely to boost their price.

Related: Best deals on cars

General Motors (GM) shares rose 3.2% in after-hours trading Monday.

The government still owned 16.4% of GM as of April 1, according to the company's most recent proxy statement, down from a high of 61%. Taxpayers are unlikely to recoup a profit from the rescue overall, though the Center for Automotive Research has estimated that the bailouts of GM and smaller rival Chrysler saved 1.5 million jobs.