NEW YORK (CNNMoney.com) -- Federal officials on Sunday unveiled an extraordinary takeover of Fannie Mae and Freddie Mac, putting the government in charge of the twin mortgage giants and the $5 trillion in home loans they back.

The move, which extends as much as $200 billion in Treasury support to the two companies, marks Washington's most dramatic attempt yet to shore up the nation's housing market, which is suffering from record foreclosures and falling prices.

The sweeping plan, announced by Treasury Secretary Henry Paulson and James Lockhart, director of the Federal Housing Finance Agency, places the two companies into a "conservatorship" to be overseen by the Federal Housing Finance Agency. Under conservatorship, the government would temporarily run Fannie and Freddie until they are on stronger footing.

"A failure [of Fannie and Freddie] would affect the ability of Americans to get home loans, auto loans and other consumer credit and business finance," Paulson said at a press conference in Washington. "And a failure would be harmful to economic growth and job creation."

Fannie (FNM, Fortune 500) and Freddie (FRE, Fortune 500), which were created by the U.S. government, have been badly hurt in the last year by the sharp decline in home prices as well as rising mortgage delinquencies and foreclosures. All told, the two firms have racked up about $12 billion in losses since last summer.

On Sunday, officials stressed that both Fannie and Freddie will be open for business on Monday morning, although the firms will have undergone a dramatic facelift by then.

Freddie CEO Richard Syron and Fannie CEO Daniel Mudd will no longer run the agencies, while the FHFA will assume control of the boards. Regulators took care not to foist blame on the two executives, adding that they would stick around to help with the transition.

Syron and Mudd will be replaced by two finance veterans charged with restoring the mortgage titans to health. Herb Allison, the former chairman and CEO of pension provider TIAA-CREF, will head Fannie Mae. Allison formerly served as president of Merrill Lynch.

David Moffett, who served as vice chairman and chief financial officer of U.S. Bancorp until early 2007 and then joined the Carlyle Group private-equity firm as a senior adviser, will take over Freddie Mac.

At the same time, dividends on both common and preferred shares will be eliminated in an effort to conserve about $2 billion annually. All of the firms' lobbying and political activities will be halted immediately and charitable activities reviewed.

In addition, the Treasury Department announced a series of moves targeted at providing relief to both housing and financial markets.

Paulson said Treasury would boost housing by purchasing mortgage-backed securities from Freddie and Fannie, as well as offering to lend money to the companies and the 12 Federal Home Loan Banks. The home loan banks advance funds to more than 8,000 member banks. (Read what Paulson said.)

The Treasury, with fellow regulator FHFA, will also buy preferred stock in Fannie and Freddie to provide security to the companies' debt holders and bolster housing finance.

The government, in agreeing to backstop the firms, said it would receive $1 billion in each company's senior preferred stock. The government will also receive a quarterly dividend payment and the right to own 79.9% of each company.

How we got here

Sunday's announcement brings an end to months of speculation about the fate of the two firms. Shares of Fannie and Freddie, which have fallen more than 80% as of the end of Friday's session, were hammered this summer among concerns they would need to raise additional funds to cover future losses or need to be taken over by its federal regulator. Investors feared that either step would reduce or wipe out the value of current shareholders' stakes.

In mid-July, the Treasury Department and Federal Reserve announced steps in to make funds available to the firms if necessary and Congress approved the sweeping proposals later that month.

Shortly thereafter, regulators stepped up their review of Fannie and Freddie. Paulson announced in August that he had tapped Wall Street firm Morgan Stanley (MS, Fortune 500) to help him examine the firms.

Sources familiar with the matter told Fortune that Morgan Stanley had determined that both Freddie and Fannie faced "meaningful" capital issues before deciding last week that government intervention was necessary. Morgan Stanley has called a firm-wide meeting on Monday morning to explain the deal.

Officials ruled out a capital infusion - a less drastic option than convervatorship - after considering questions such as whether the government would have to keep putting money in and how best Treasury officials could protect taxpayers, according to one of the sources.

In the end, the route taken amounts to "a timeout, not a liquidation," says the source. "Conservatorship leaves all options open for the next administration."

Following an exhaustive review, FHFA's Lockhart said Sunday that the two companies could not continue to operate without taking "significant action."

Fannie and Freddie have become virtually the only source of funding for banks and other home lenders looking to make home loans. Their ability to do so is crucial to the recovery of the battered home market and the broader U.S. economy.

The two firms buy loans, attach a guarantee, then sell securities backed by the loans' income stream. All told, they own or back $5.4 trillion worth of home debt - half the mortgage debt in the country.

Reaction to the news

The Treasury-FHFA plan, which was widely anticipated after financial markets closed on Friday, drew praise from regulators, lawmakers and some market experts.

President Bush called the move "critical" to the housing market recovery. "Americans should be confident that the actions taken today will strengthen our ability to weather the housing correction and are critical to returning the economy to stronger sustained growth in the future," he said.

Federal Reserve Chairman Ben Bernanke, who along with Paulson has led efforts to help get the U.S. housing market and the broader economy back on track, endorsed the move by Lockhart and Paulson.

"These necessary steps will help to strengthen the U.S. housing market and promote stability in our financial markets," Bernanke said in a statement.

Sen. Charles Schumer, D-N.Y., a member of the Senate Banking Committee, said that Paulson had "threaded the needle just right" with the plan, noting that it will likely be met with praise from other lawmakers.

At first blush, Wall Street seemed encouraged by the news, although the true test will come when financial markets around the globe open Monday. Pimco's Bill Gross, a widely followed bond fund manager, said that the Freddie-Fannie plan was the right move.

"This is a significant step and almost exactly what we had hoped for," Gross told CNNMoney.com Sunday.

In addition to confirming the government's sovereign credit rating, Standard & Poor's affirmed its sterling AAA rating on both Fannie Freddie on the news, adding that its outlook for the two firms is stable.

Unanswered questions

The cost of the government intervention remains unclear however. Experts argue that it will depend in large part on the structure of the rescue, the direction of home prices and mortgage default rates.

Still it seems almost certain it will run into the billions and will most likely eclipse such other high-profile government bailouts including than the Federal Reserve's $29 billion backing of Bear Stearns assets when it was taken over by J.P. Morgan Chase.

Paulson said that the cost to taxpayers would largely depend on the future financial performance of Fannie and Freddie.

Another unintended yet unavoidable consequence may be the impact to the nation's banks.

Some of the nation's largest financial institutions including JPMorgan Chase (JPM, Fortune 500) and Sovereign Bancorp (SOV, Fortune 500) own a big chunk of the estimated $36 billion in preferred shares of Fannie and Freddie, according to research published last month by Keefe, Bruyette & Woods, an investment bank that specializes in financial firms. Those stakes are at risk of being wiped out as a result of Sunday's announcement.

Top banking regulators, including the Federal Reserve as well as the Federal Deposit Insurance Corp., said in a joint statement Sunday that a limited number of smaller institutions have significant preferred share holdings in Fannie and Freddie. They added they are prepared to work with these institutions to come up with a plan should they need to raise capital.

Still, the rescue of Fannie and Freddie could go a long way toward its intended aim - bringing stability to the housing market while making it easier for consumers to obtain affordable mortgages.

An earlier version of this article incorrectly stated that the government would invest $1 billion in each company's preferred stock.

--CNNMoney.com senior writer Tami Luhby and Fortune editor at large Patricia Sellers contributed to this report.