Standard & Poor's says the U.S. government sued the rating agency as "retaliation" for its downgrade of the country's credit rating.
The Department of Justice filed civil charges against the rating agency in February, claiming that S&P refused to warn investors that the housing market was collapsing because it would be bad for business. It also says S&P knowingly inflated ratings of risky mortgage investments that helped trigger an economic crisis. And that S&P gave high marks to the investments because it wanted to earn more business from the banks that issued them.
The government is seeking $5 billion in penalties.
S&P, a unit of McGraw Hill Cos., has repeatedly denied the claims.
The rating agency said in a court filing Tuesday that its opinions were independent and based on a good-faith assessment of the performance of residential mortgages during a tumultuous time in the market.
It also said that, like nearly everyone else at the time, S&P did not anticipate the scope or impact of the collapse of the housing market on the economy as a whole.
S&P says that it is being sued in retaliation for a downgrade of the United States' top-tier credit rating in 2011.
The rating agency downgraded the U.S. government's long-term credit rating one notch to "AA+" following a standoff in Congress over whether to raise America's borrowing limit. The agency was concerned that the country's leaders weren't addressing the federal debt burden.
It was a historic move that sent the stock market plunging and rattled consumer and business confidence. Previously, the U.S. government had always received a "AAA" rating, reserved for the most credit-worthy borrowers.
S&P said in court documents that it was exercising its right to free speech with the downgrade and that its concerns echoed those of other rating agencies.
"Only S&P Ratings downgraded the United States and only S&P Ratings has been sued by the United States," it said in the court filing.
A representative for the Justice Department did not respond immediately to a request for comment.
S&P wants the lawsuit dismissed with prejudice, meaning that it cannot be brought again.
Standard & Poor's Ratings Services reaffirmed the country's "AA+" rating in June and upgraded its outlook to "Stable" from "Negative" on some easing of Washington's political gridlock, a recovering U.S. economy and stronger government finances.
The improved outlook means it's less likely to downgrade the U.S. debt in the near future.
AP Business Writer Marcy Gordon contributed to this report from Washington D.C.