The Obama administration attacked the credibility of the analysis underlying Standard & Poor's decision to downgrade the United States' top credit rating on Friday, saying it had found a $2 trillion error.

S&P was forced to remove the number from its analysis after Treasury officials discovered that the rating agency's estimates of the government's discretionary spending was $2 trillion too high, sources familiar with the discussions said.

There was evident dismay, and some anger, within the Obama administration at S&P's decision to downgrade U.S. debt despite the errors officials said they had found in the calculations.

A judgment flawed by a $2 trillion error speaks for itself, a Treasury spokesman said after S&P cut the long-term U.S. credit rating by one notch to AA-plus on concerns about growing budget deficits.

The comment marked the first time the U.S. Treasury had publicly chastised S&P. Administration officials have privately grumbled that the rating agency's understanding of the U.S. political system was unsophisticated.

David Beers, the top S&P official behind the ratings decision, told Reuters in an interview that any change in the rating agency's calculations would have been taken into consideration before the decision was made public.

Sources familiar with talks that took place between S&P and the U.S. Treasury on Friday afternoon said the rating agency had wanted to see $4 trillion sliced from future budgets as part of a hard-fought deal secured earlier this week to lift the nation's debt limit. That agreement would reduce deficits by $2.1 trillion over 10 years.

Even after the error was pointed out, the rating agency declined to hold off on its downgrade, sources said.

With the threat of a downgrade looming, Treasury officials earlier in the week had played down the potential impact and said markets already were aware it was under consideration and that two other agencies were maintaining their triple-A rating.

The Federal Reserve effectively shrugged off the downgrade, saying it would not affect the operation of the central bank's emergency lending window or its buying and selling of Treasury securities to conduct monetary policy. The Fed can only extend emergency loans to banks against good collateral.

PLENTY OF FINGER POINTING

Treasury officials, who spoke on condition of anonymity, said on Wednesday that top bond dealers were questioning S&P's credibility, which took a heavy blow during the 2007-09 financial crisis when mortgage-related debt lost much of its value after originally being awarded high ratings. The reputations of two other big rating agencies, Fitch and Moody's, were also tarnished.

Ian Lyngen, a senior government bond strategist at CRT Capital Group in Connecticut, agreed S&P now had more than just a credibility problem.

The fact that they have now downgraded the United States suggests to me that they are now going to be dealing with a relevance issue, he said. Because the fact of the matter is that 10-year (Treasury note) yields are near 2.5 percent, and that in no way suggests a lack of sponsorship for U.S. debt.

Yields on U.S. 10-year notes, a benchmark for borrowing rates throughout the economy, fell as far as 2.34 percent on Friday -- their lowest since October 2010 and very low by historical standards.

POLITICAL POINT SCORING

Lawmakers used the downgrade to square off over how best to rein in the nation's budget gap, with Democrats saying more revenue was needed and Republicans focusing on spending cuts.

S&P's action reaffirms the need for a balanced approach to deficit reduction that combines spending cuts with revenue-raising measures, said Senate Majority Leader Harry Reid, a Democrat from Nevada.

House of Representatives Speaker John Boehner, a Republican from Ohio, called the downgrade the latest consequence of the out-of-control spending that has taken place in Washington for decades.

Sen. Jim DeMint, a leading conservative, went further, saying Treasury Secretary Timothy Geithner should resign.

The White House maintained silence, but Dan Pfeiffer, Obama's communications director, signaled the administration's strategy -- to put the blame on the Republicans -- when he added bits of media commentary to his Twitter.com feed, an increasingly common vehicle for transmitting the White House viewpoint.

One retweet he sent from a Washington Post columnist said, This didn't happen because an earthquake wrecked our factories or a plague hit our workers. It was Congress. Particularly (Republicans)in Congress.

Another retweet from a Fox News reporter read: Remember President Obama pushed for a 'Grand Bargain' that would have cut approximately $4 trillion in debt, but Speaker John Boehner walked.

A Republican-led congressional panel is probing whether the administration had tried to influence S&P before the rating agency revised its outlook on the U.S. debt rating to negative in April.

(Additional reporting by Matt Spetalnick, Mark Felsenthal, David Lawder and Christopher Doering; Writing by Rachelle Younglai; Editing by Clive McKeef and Jan Paschal)