Ally Financial, one of the biggest US companies still under a government bailout, said Tuesday it will pay almost $6 billion to buy back its shares held by the US Treasury. Ally, the former financial arm GMAC of General Motors that was rescued from bankruptcy in the 2008 financial crisis, said it would repurchase the Treasury\'s preferred shares, which carry a priority dividend, for $5.2 billion in a move to bolster its balance sheet. It will also pay $725 million to end the Treasury\'s share adjustment right. The Detroit, Michigan-based auto lender and bank holding company said that, as part of the plan to repay the US taxpayer, it had struck agreements to sell common stock that totaled $1 billion. Ally received a $17 billion bailout under the Treasury\'s Troubled Asset Relief Program (TARP). The Treasury currently holds a majority 74 percent stake in the company. Ally failed a fresh round of Federal Reserve stress tests on major US banks in March, and the deals announced Tuesday would help to shore up its capital base. The announcement came a day after the Federal Reserve reported that the 18 major US banks that had undergone stress tests as part of the post-crisis financial reform were falling short in capital planning. The Fed\'s report to Congress on Monday did not identify the individual banks with problems. Under the agreements announced Tuesday, Ally\'s common-stock sale must take place by November 30 and is subject to several conditions, including the repurchase of the Treasury-held shares. \"These transactions are key steps in Ally\'s journey toward repaying the remaining investment by the US taxpayer,\" Ally chief executive Michael Carpenter said in a statement. Carpenter noted that the bank had undergone a complete restructuring in recent years, and that strong investor interest in the common-stock sale had underscored the company\'s progress. \"The actions announced today will clear the way for Ally to pursue the next steps to ultimately exit the TARP program and enable its operations to further thrive,\" he said. Ally said it had paid the Treasury $6.2 billion on its investment and, with the new agreements, will have paid about $12.1 billion, more than two-thirds of the rescue.