A downgrade of United States' top-tier credit rating has Wall Street scrambling to figure out the knock-on effects for the financial system, from mortgages to banks to markets that rely on U.S. Treasuries for collateral.

The immediate effects of the Standard & Poor's downgrade of the country's AAA credit rating late on Friday are likely to be modest, largely because it was expected and already at least partly discounted, experts said.

Many downplayed the likelihood of the sort of financial contagion experienced when Lehman Brothers went under in September 2008. Few had expected it to have to file for bankruptcy, and few were prepared for the fallout. Money market funds froze, some major commercial banks collapsed, and many major dealers and finance houses teetered on the edge of failure.

But even if that type of scenario is unlikely this time, bankers, lawyers and investors wonder if there could be longer-term consequences of S&P's downgrade, given that U.S. sovereign credit is bedrock to the world financial system.

The analysis is complicated because so many of the potential stress points for the financial system are relatively opaque areas like over-the-counter derivatives markets.

Adding to the difficulties is the concern that the downgrade is only one of the many issues roiling global markets. The European debt crisis is spreading, with Italy and Spain coming under the gun after Greece, and data in recent weeks point to a weaker U.S. economy than many investors had thought and have led to fears of another recession.

I actually think it is going to end up having more of an impact than some of the news stories are suggesting, said Thomas Stoddard, a senior managing director at Blackstone Group who focuses on financial services investment banking.

Not having the U.S. as triple-A is just going to pop up in more places and have more frictional costs than people might suspect, Stoddard added.

A number of entities that are key players in the U.S. financial system -- including mortgage finance companies Fannie Mae and Freddie Mac, and securities clearinghouses like the Options Clearing Corp Depository Trust Co -- are likely to be downgraded by Standard & Poor's on Monday.

For Fannie Mae and Freddie Mac, losing their triple-A rating could lift borrowing costs, potentially making mortgages more expensive for consumers and adding to stress in the already unstable U.S. housing market.

Last month, S&P said it may also cut ratings for companies like the Depository Trust Co, which facilitates payment transfers among major banks, and several Federal Home Loan Banks and Farm Credit System Banks.

On Friday evening, when S&P cut the United States' sovereign rating by one notch to AA-plus, it said it would offer more detail about the ratings for these companies on Monday.

DERIVATIVES MARKETS

Another source of potential stress is derivatives markets, where investors and banks often collateralize their positions using U.S. Treasuries.

If banks start demanding more Treasuries to collateralize the same exposure, investors could be forced to sell assets to come up with extra collateral, causing broader market declines. As long as Treasury yields are at all time lows, that risk seems relatively low, said a hedge fund trader who spoke on condition of anonymity.

Some derivatives transactions may have ratings triggers built into them that unwind the deals if the U.S. is downgraded, the trader said, but he said it is difficult to know how many such transactions are out there.

But there are some factors working in markets' favor, analysts noted.

For one thing, major U.S. banks are better capitalized as credit losses have slowed. The U.S. banking system had $1.51 trillion of equity capital at the end of the first quarter, compared with $1.29 trillion in the fourth quarter of 2008. That roughly 17 percent of extra capital is supporting about 3 percent fewer assets than it used to.

If stresses become strong in areas like the repo market, a massive market that banks use to fund securities short-term, dealers are fairly sure the Federal Reserve can jump in to offer support, as it did during the credit crunch, the trader said.

Any impact in the derivatives market will be less than what the pessimists fear, said Michael Holland, founder of asset manager Holland & Co. I don't expect major disruptions in markets just from the downgrade.

BORROWING COSTS

Borrowing costs for companies with top ratings like Microsoft Corp and Exxon Mobil Corp could drop, because triple-A rated debt may be even more attractive to some investors now, analysts said. Some companies have at times had more available cash on their balance sheets than the U.S. government in recent weeks.

In general, corporate borrowing costs may not rise following the U.S. downgrade. Last week, when many in the market were expecting the U.S. to be downgraded, six U.S. companies issued 30-year bonds, which is unusually long-dated for the corporate market.

Even highly-rated corporate bonds have seen their risk premiums rise in recent sessions, signaling that portfolio managers are still concerned about credit risk. As turmoil in Europe ratchets higher, those risk premiums may rise more. But investors' willingness to buy long-term corporate debt signals some confidence in the sector.

To a certain extent, corporate debt may look even more attractive, especially cash-rich balance sheet companies with lots of liquidity, said Chip MacDonald, a financial services partner at law firm Jones Day.

STATE FINANCES

States that rely heavily on federal government spending -- such as Virginia and Maryland, which are home to many federal employees and defense contractors -- could suffer if Congress and President Barack Obama slice the federal budget more deeply.

A downgrade of Fannie Mae and Freddie Mac would affect billions of dollars of debt issued by public housing authorities secured by federally guaranteed mortgages.

Hospital credits could be weakened if the federal government slashes programs such as Medicaid -- the health plan for the elderly, poor and disabled that accounts for as much as 30 percent of state spending. Stocks in the health care sector sold off last week, amid fears of declining government support for spending in the sector.

The degree of dependence on the federal government now becomes a state credit issue, said Philip Fischer a managing principal at eBooleant Consulting, in a recent report.

S&P is also expected to immediately downgrade pre-refunded bonds. When municipal bonds are refunded, investors are typically repaid from Treasuries held in escrow.

Debt issued by AAA-rated universities and colleges with global reputations might rise in price, said Evan Rourke, a portfolio manager, with Eaton Vance, citing Harvard and Princeton as examples.

Indeed, the immediate impact of the downgrade might be muted by the tax-free market's traditional strengths.

I don't see a tremendous flight out of municipals. You might see credit spreads widening for lower-rated issues but we also think a lot will hold their ratings, Rourke said.

(Reporting by Paritosh Bansal and Dan Wilchins, additional reporting by Joan Gralla and Ben Berkowitz; Editing by Marguerita Choy)