The US Treasury sold its last shares in General Motors on Monday, ending the dramatic rescue of the auto giant at the height of the financial crisis five years ago.

The Treasury took a loss of more that $10 billion on the $49.5 billion bailout, but said that saving the US auto industry, the jobs of millions of auto workers and the pensions of many retirees was worth it.

The 2008 rescue, controversial at the time, "helped stabilize the auto industry, and prevent another Great Depression," Treasury Secretary Jacob Lew said.

He said that President Barack Obama "understood that inaction could have cost the broader economy more than one million jobs, billions in lost personal savings, and significantly reduced economic production.

"As a result of his efforts, which built on those of the previous administration, more than 370,000 new auto jobs have been created, and all three US automakers are profitable, competitive, and growing."

In late 2008 the administration of then-president George W. Bush began the rescue of the industry which was then expanded into a comprehensive program by his successor Obama.

It was attached to the massive Troubled Asset Relief Program set up to rescue banks, amid worries that the collapse of the automobile industry would plunge the US economy into deep depression.

The government took financial control of both GM, the largest US automaker, and Chrysler. Canadian authorities, worried about auto industry job losses on their side of the border, also took part in the rescues.

The number two producer, Ford, opted to stand on its own -- though analysts say that Ford benefited from the rescue of the two competitors, bolstering general confidence as well as saving the parts industry that all three share.

Treasury officials said the bailout of GM and Chrysler, which it exited earlier with the sale of most of its shares to Italian carmaker Fiat, would leave it with a net loss of about $15 billion.

In addition, the government also took over GM's finance arm, now bank holding company Ally Financial, which the government still controls.

In a new study, the Center for Automotive Research said the government's loss was paltry compared with the losses risked by letting GM and Chrysler go under.

Not including the potential impact on the parts sector, the study said the US government "saved or avoided the loss of $105.3 billion in transfer payments and the loss of personal and social insurance tax collections -- or 768 percent of the net investment," the study said.

"Additionally, 2.6 million jobs were saved in the US economy in 2009 alone and $284.4 billion in personal income saved over 2009-2010."

General Motors chairman and chief executive Dan Akerson expressed gratitude Monday for the government support.

"The US Treasury's ownership exit closes just one chapter in GM's ongoing turnaround story. We will always be grateful for the second chance extended to us and we are doing our best to make the most of it," he said in a statement.

[Image via Agence France-Presse]