Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Bank of America was hit with almost $1.3 billion in civil penalties Wednesday for a housing meltdown scam run by a subsidiary that a jury found intentionally sold bad mortgages to Freddie Mac and Fannie Mae.

Bank of America said it shouldn't have to pay up because it bought the unit, Countrywide Financial Corp., in 2008 during the subprime mortgage crisis — after the so-called Hustle program ended.

"We believe that this figure simply bears no relation to a limited Countrywide program that lasted several months and ended before Bank of America’s acquisition of the company," it said in a statement.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Bank of America said it was exploring an appeal and that it should be legally responsible for only $1.1 million of the $2.7 billion judgment.

But Judge Jed S. Rakoff said in a 19-page ruling (PDF) in U.S. District Court in Manhattan that it assumed Countrywide's legal liabilities when it purchased the company.

In October, a federal jury found Countrywide and one of its senior executives, Rebecca Mairone, guilty of fraud for selling Fannie Mae and Freddie Mac more than 17,000 home loans that they knew were bad. Rakoff ordered Mairone to pay $1 million.

Rakoff wrote that the fraud allowed Countrywide and Bank of America to "unload a vast portfolio of risky assets on unwitting buyers" which allowed them to "reduce the risk on their own balance sheet at a crucial moment in time — the nadir of the housing meltdown, when they knew they would "no longer find willing buyers for the subprime mortgages."

"It was from start to finish the vehicle for a brazen fraud by the defendants, driven by a hunger for profits and oblivious to the harms thereby visited, not just on the immediate victims but also on the financial system as a whole," he declared.

Preet Bharara, the U.S. attorney for the Southern District of New York, said the penalties "make clear that mortgage fraud cannot be viewed as simply another cost of doing business in the financial world."

"Judge Rakoff's opinion squarely and emphatically rejects the bank's claims which, besides ignoring the victims' out-of-pocket losses, also ignored that the fraudulent conduct required penalties to be paid for punitive and deterrence purposes as well," he said in a statement.

Bank of America is separately trying to hammer out a settlement that would avoid its going to trial over allegations that Countrywide sold billions of dollars' worth of other bad securities to federally backed investors. Bank lawyers met with Justice Department prosecutors Wednesday in Washington to continue those negotiations, The New York Times reported.