American International Group Inc posted a record $61.7 billion quarterly loss on Monday and got a new but not necessarily final government bailout, after officials concluded again that letting the insurer fail would threaten the world financial system.

AIG will get access to up to $30 billion of new capital after getting a commitment for $150 billion in aid last year that gave the government a stake of nearly 80 percent.

The latest bailout increases the government's commitment to keeping AIG on life support, and avoids for now any crippling credit rating downgrades that could force AIG to come up with billions of dollars it might not have.

It's a pretty strong reminder that the U.S. Treasury is still all that stands between the current market environment and the ongoing threat of systemic financial meltdown, said Christopher Garman, head of Garman Research LLC in Orinda, California, and a former Merrill Lynch bond strategist.

White House spokesman Robert Gibbs said today's actions were critical to preventing AIG from further threatening the financial system.

Separately, the Treasury Department and Federal Reserve said urgent action was needed now to keep AIG in business.

Given the systemic risk AIG continues to pose and the fragility of markets today, the potential cost to the economy and the taxpayer of government inaction would be extremely high, they said in a joint statement.

Monday's agreement came three days after a new federal bailout for Citigroup Inc, which like AIG has struggled to sell businesses and raise cash to repay the government.

The market is a pretty crummy place right now, AIG Chief Executive Edward Liddy lamented on a conference call. He said fixing the insurer could take several years.

BLEEDING TERRIBLY

AIG's fourth-quarter loss of $22.95 per share widened from $2.08 per share, or $5.29 billion, a year earlier.

Most of the loss stemmed from big writedowns tied to credit default swaps and other toxic debt.

The latest loss equaled about $465,000 a minute, and was a record for a U.S. company, according to Thomson Reuters data.

For all of 2008, AIG lost $99.29 billion, wiping out profits dating to the early 1990s. That amount is close to the gross domestic product of Kuwait.

AIG built up its exposure to swaps earlier this decade, when long-time CEO Maurice Hank Greenberg and then Martin Sullivan ran the company.

Swaps were underwritten at the AIG Financial Products unit, run by London-based executive Joseph Cassano.

In afternoon trading, AIG shares were up 4 cents at 46 cents. The cost of insuring AIG debt fell, suggesting a lower risk of default. But U.S. stocks tumbled, with the Dow Jones industrial average falling below 6,800, and the Standard & Poor's 500 shedding more than 4 percent.

What's really overhanging the market is AIG. We gave them all that money, and they are obviously still bleeding terribly, said Warren Simpson, managing director at Stephens Capital Management in Little Rock, Arkansas.

SYSTEMIC RISK

The new bailout gives AIG more lenient terms on existing financing. AIG will convert some debt into a preferred equity stake for the government in its American International Assurance Co and American Life Insurance Co units, which each have significant Asian operations.

AIG also said it plans to spin off part of its property-casualty business, to be renamed AIU Holdings. It said it believes it has enough liquidity for the next year.

In agreeing to a new bailout, the Treasury and Fed cited AIG's operations in more than 130 countries, its role as an insurer for more than 100,000 entities, and has more than 30 million U.S. policyholders.

The government also acknowledged the bailout might not be AIG's last. It said fixing the insurer will take time and possibly more government support if markets do not stabilize and improve.

AIG's roots date back 90 years to China where founder C.V. Starr, a U.S. entrepreneur, set up a small insurance agency.

The government appointed Liddy, a former CEO of Allstate Corp, to run AIG in September.

On the conference call, Liddy said AIG had become too complicated, unwieldy and opaque to operate as it has.

'NOWHERE ELSE TO TURN'

Donn Vickrey, an analyst with independent research firm Gradient Analytics in Scottsdale, Arizona, said the government's commitment to AIG may ultimately reach a quarter trillion dollars, much of which it may not recoup.

AIG really has nowhere else to turn, he said. Taxpayers are stuck with trying to unwind it slowly over time. Hopefully there will be something left over at the end.

Major credit rating agencies affirmed AIG's ratings, which fall in the single-A category, a medium investment grade.

Moody's Investors Service analyst Bruce Ballentine said he expected the government will provide incremental support as needed to ensure that AIG can meet its obligations through this period of severe economic recession and market turmoil.

(Additional reporting by Karen Brettell, Chuck Mikolajczak and Walden Siew in New York, and Matt Spetalnick and Glenn Somerville in Washington; editing by Ted Kerr and Jeffrey Benkoe)