In an effort to rescue banking giant Citigroup, the U.S. government has agreed to commit $20 billion into the company, the U.S. financial heads announced late Sunday. The action, announced by the Treasury Department, the Federal Reserve and the Federal Deposit Insurance Corporation, is aimed at shoring up a huge financial institution whose collapse would ruin the already fragile financial system and the U.S. economy. “With these transactions, the U.S. government is taking the actions necessary to strengthen the financial system and protect U.S. taxpayers and the U.S. economy. We will continue to use all of our resources to preserve the strength of our banking institutions, and promote the process of repair and recovery and to manage risks,” the three agencies said in a joint statement. The Citigroup rescue came after a weekend of marathon discussions led by Treasury Secretary Henry Paulson and Fed Chairman Ben Bernanke. The $20 billion cash injection by the Treasury Department will come from the $700 billion financial bailout package. The capital infusion follows an earlier one—of $25 billion—in Citigroup in which the government also received an ownership stake. As part of the plan, Treasury and the FDIC will guarantee against the “possibility of unusually large losses” on up to $306 billion of risky loans and securities backed by commercial and residential mortgages. Under the loss-sharing arrangement, Citigroup will assume the first $29 billion in losses on the risky pool of assets. Beyond the $29 billion, the government would absorb 90 percent of the remaining losses, and Citigroup 10 percent. Money from the $700 billion bailout and funds from the FDIC would cover the government's portion of potential losses. The Federal Reserve would finance the remaining assets with a loan to Citigroup. In exchange for the guarantees, the government will get $7 billion in preferred shares of Citigroup.