WASHINGTON — The federal government rushed to the aid of faltering banking giant Citigroup Inc. Sunday night, agreeing to invest $20 billion more and accept the lion's share of losses on more than $300 billion worth of the company's troubled mortgage-backed assets.

WASHINGTON — The federal government rushed to the aid of faltering banking giant Citigroup Inc. Sunday night, agreeing to invest $20 billion more and accept the lion's share of losses on more than $300 billion worth of the company's troubled mortgage-backed assets.

In the largest single rescue effort in the current financial crisis, the Treasury Department, the Federal Reserve and the Federal Deposit Insurance Corp. will shoulder 90 percent of the losses on most of a $306 billion portfolio of toxic mortgages and related securities. The company will cover the first $36 billion of losses but beyond that will see its risk of loss shrink drastically.

In return for the protection and the current and past investments, Citigroup will grant Washington nearly $30 billion of preferred shares and warrants. The company will give the government sweeping powers over its operations, effectively allowing it to prohibit stock dividends for the next three years and pass judgment on all executive pay packages.

And the company will agree to try to modify mortgages in the huge portfolio, using standards designed by the FDIC after the collapse of IndyMac Bank to keep as many homeowners as possible in their houses.

Washington acted after Citigroup became the latest — and largest — financial institution to see a sell-off of its stock. The New York company lost 60 percent of its value in Wall Street trading last week.

The company is one of the world's best-known banking operations with nearly $2.2 trillion in assets and more than 200 million customers in 106 countries. Citigroup already has received $25 billion from Treasury as part of the department's $700 billion financial rescue scheme. In return, Washington got an ownership stake.

Government officials made clear they believed that permitting any further trouble at Citigroup could shake investor and depositor confidence in the global financial system and dramatically deepen what already is the country's worst financial crisis since the Great Depression.

"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," the three agencies said in a statement. "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."

For Citigroup's top management — including chief executive Vikram Pandit and senior counselor and director Robert Rubin — the government rescue represented an abrupt about-face. As recently as Thursday, Pandit was declaring that the stock drop posed no financial danger to the company and that he had no intention of selling off pieces of the business in order to raise money.

But by Friday, with Citigroup shares still falling even amid a market rally, executives had little choice but to seek help. The shares ended up losing $5.75 for the week, closing Friday at $3.77 a share. The executives presented a rescue plan Friday evening, setting off negotiations that lasted well into the night Sunday.

Among those at the table: Treasury Secretary Henry M. Paulson Jr., Federal Reserve Chairman Ben S. Bernanke and Timothy F. Geithner, head of the Federal Reserve Bank of New York and President-elect Barack Obama's pick for the top Treasury post.