The agency was sued in February over its assessment of mortgage-backed securities before the financial crisis.
The suit alleged that S&P turned a blind eye to risks in the products, and gave them ratings that were too high.
The US government is seeking $5bn (£3bn) in penalties.
In a court filing on Tuesday, S&P, which had previously said the case was without merit, claimed that it was being sued in retaliation for its downgrade of the US credit rating in 2011.
S&P downgraded the US rating in August 2011 by one notch, from AAA to AA+, amid a standoff in Congress over whether to raise the country’s borrowing limit.
It had cited concerns about budget deficits as the reason behind the downgrade.
“Only S&P Ratings downgraded the United States and only S&P Ratings has been sued by the United States,” S&P said in the court filing.
The lawsuit is the first to be brought against a ratings agency for alleged wrongdoing connected to the financial crisis.
In the run-up to the global financial crisis, investment banks routinely hired ratings agencies to assess the creditworthiness of investment products called Collateralised Debt Obligations, or CDOs.
These were complex financial transactions that packaged together thousands of loans given to individual homebuyers.
The ratings agencies were asked to assess the probability that the home loans, and, as a result, the CDOs, would ultimately be repaid.
A top tier rating made it easier for the investment banks which put the CDOs together to sell them to investors around the world.
However, as the value of these products collapsed various agencies, including S&P, were criticised for assigning top ratings to them.
In its lawsuit, the Justice Department has alleged that S&P gave them the top ratings because it wanted to encourage investors to buy more CDOs so that it could earn more fees.
S&P has denied those allegations. But earlier this year it said that it “deeply regrets” that its ratings failed to anticipate the market conditions.