NEW YORK (CNNMoney.com) -- In an unprecedented move, the Federal Reserve Board is lending as much as $85 billion to rescue crumbling insurer American International Group, officials announced Tuesday evening.

The Fed authorized the Federal Reserve Bank of New York to lend AIG (AIG, Fortune 500) the funds. In return, the federal government will receive a 79.9% stake in the company.

Officials decided they had to act lest the nation's largest insurer file bankruptcy. Such a move would roil world markets since AIG (AIG, Fortune 500) has $1.1 trillion in assets and 74 million clients in 130 countries.

An eventual liquidation of the company is most likely, senior Fed officials said. But with the government loan, the company won't have to go through a tumultuous fire sale.

"[A] disorderly failure of AIG could add to already significant levels of financial market fragility and lead to substantially higher borrowing costs, reduced household wealth and materially weaker economic performance," the Fed said in a statement.

The bailout marks the most dramatic turn yet in an expanding crisis that started more than a year ago with the mortgage meltdown. The resulting credit crunch is now toppling not only mainstay Wall Street players, but others in the wider financial industry.

The line of credit to AIG, which is available for two years, is designed to help the company meet its obligations, the Fed said. Interest will accrue at a steep rate of 3-month Libor plus 8.5%, which totals 11.31% at today's rates.

AIG will sell certain of its businesses with "the least possible disruption to the overall economy." The government will have veto power over the asset sales and the payment ofdividends to shareholders.

The company's management will be replaced, though Fed staffers did not name the new executives. Edward Liddy, the former head of insurer Allstate Corp (ALL, Fortune 500)., will lead the company, the Wall Street Journal reported.

The board will remain. For customers, it will be business as usual, officials said.

Taxpayers will be protected, the Fed said, because the loan is backed by the assets of AIG and its subsidiaries. The loan is expected to be repaid from the proceeds of the asset sales.

The government had resisted throwing a lifeline to AIG, hoping to entice investment firms to set up a $75 billion rescue fund. Officials opted not to bail out Lehman Brothers, which filed for bankruptcy on Monday. But by Tuesday night, it became clearer that the private sector would not step in to help AIG, which has a greater reach into other financial companies and markets than Lehman does.

"We are working closely with the Federal Reserve, the SEC and other regulators to enhance the stability and orderliness of our financial markets and minimize the disruption to our economy," said Treasury Secretary Henry Paulson. "I support the steps taken by the Federal Reserve tonight to assist AIG in continuing to meet its obligations, mitigate broader disruptions and at the same time protect the taxpayers."

Dramatic end, high stakes

The firm's options grew more limited as the day wore on. Its already-battered share price fell another 21% with more than 1 billion shares trading hands, and plummeted another 46% in after-hours trading.

At one point Tuesday morning, shares fell more than 70% - a day after losing 61% of their value.

In a statement late Tuesday night the company said, "AIG is a solid company with over $1 trillion in assets and substantial equity, but it has been recently experiencing serious liquidity issues. We believe the loan, which is backed by profitable, well-capitalized operating subsidiaries with substantial value, will protect all AIG policyholders, address rating agency concerns and give AIG the time necessary to conduct asset sales on an orderly basis."

The company also commended the Federal Reserve and the Treasury Department for "taking action to address AIG's liquidity needs and broader financial market concerns."

Furthermore, the firm expressed its gratitude to New York Governor Paterson, and other NY State as well as Federal officials.

New York State officials, who regulate the insurance titan, had urged the federal government to rescue AIG. The state attempted to help AIG on Monday by allowing it to tap into $20 billion in assets from its subsidiaries if the company could comes up with a comprehensive plan to get the much-needed capital, said a state Insurance Department spokesman.

Pleased with the federal government's response, New York Gov. David Paterson said Tuesday night: "Policy holders will be protected. Jobs will be saved. Business will continue."

The funding became ever more crucial as the insurer was hit Monday night by a series of credit rating downgrades. The cuts meant AIG (AIG, Fortune 500) could be forced to post more than $13 billion in additional collateral.

Late Monday night, Moody's Investors Service and Standard & Poor's Ratings Services each said they had lowered their ratings. A few hours earlier, Fitch Rating had also downgraded AIG, saying the company's ability to raise cash is "extremely limited" because of its plummeting stock price, widening yields on its debt, and difficult capital market conditions.

The downgrade could force AIG to post $13.3 billion of collateral, Fitch said in a statement. Also, the moves would make it more expensive for AIG to issue debt and harder for it to regain the confidence of investors.

All the while, analysts urged the company to unveil its restructuring plan.

"Management needs to address investor concerns now before the market sell-off becomes a self-fulfilling prophecy," Rob Haines, analyst at CreditSights, said Tuesday.

Global ripples

The failure of AIG could have caused unprecedented global ripple effects, said Robert Bolton, managing director at Mendon Capital Advisors Corp. AIG is a major player in the market for credit default swaps, which are insurance-like contracts that guarantee against a company defaulting on its debt. Also, it is a huge provider of life insurance, property and casualty insurance and annuities.

"If AIG fails and can't make good on its obligations, forget it," Bolton said. "It's as big a wave as you're going to see."

AIG has had a very tough year.

Rocked by the subprime crisis, the company has lost more than $18 billion in the past nine months and has seen its stock price fall more than 91% so far this year. It already raised $20 billion in fresh capital earlier this year.

Its troubles stem from its sales of credit default swaps and from its subprime mortgage-backed securities holdings.

AIG has written down the value of the credit default swaps by $14.7 billion, pretax, in the first two quarters of this year, and has had to write down the value of its mortgage-backed securities as the housing market soured.

The insurer could be forced to immediately come up with $18 billion to support its credit swap business if its ratings fall by as little as one notch, wrote John Hall, an analyst at Wachovia, on Monday.

This year's results have also included $12.2 billion in pretax writedowns, primarily because of "severe, rapid declines" in certain mortgage-backed securities and other investments.

The company brought in new management to try to turn the company around. In June, the company tossed out its chief executive, Martin Sullivan, and named AIG chairman Robert Willumstad, who joined AIG in 2006 after serving as president and chief operating officer of Citigroup (C, Fortune 500), in his place.