The U.S. government ended up losing $10.5 billion US on its bailout of General Motors, but still says the alternative would have been much worse.

Treasury Secretary Jacob Lew announced Monday that the government sold its remaining shares in the Detroit automaker.

The government received 912 million GM shares, or a 60.8 per cent stake in the automaker, in exchange for a $49.5 billion bailout during the financial crisis in 2008 and 2009. It recovered $39 billion of the money, meaning taxpayers came up more than $10 billion short.

But Lew says the rescue was necessary to save one million jobs and stop the American auto industry from collapsing.

GM shares rose 1.2 per cent in after-hours trading following the announcement. They rose 1.8 per cent in regular trading, at one point reaching $41.17, the highest level since GM returned to the markets with a November 2010 initial public offering.

The U.S.-based Center for Automotive Research estimated the government bailouts of Chrysler LLC and General Motors Co. saved 2.6 million jobs in the U.S. economy in a study released today.

“In the years ahead, this peacetime intervention in the private sector by the U.S. government will be seen as one of the most successful in U.S. economic history,” it said.

Earlier Monday, Mark Reuss, GM's North American president, told reporters in Warren, Mich., that a government exit would boost sales, especially among pickup truck buyers.

GM has said repeatedly that some potential customers have stayed away from its brands because they object to the government intervening in a private company's finances. Because of the bailout, the company has been given the derisive nickname "Government Motors."

GM went through bankruptcy protection in 2009 and was cleansed of most of its huge debt, while stockholders lost their investments. Since leaving bankruptcy, GM has been profitable for 15 straight quarters, racking up almost $20 billion in net income on strong new products and rising sales in North America and China. It also has invested $8.8 billion in U.S. facilities and has added about 3,000 workers, bringing U.S. employment to 80,000.