A federal judge has ordered Bank of America’s (BAC) Countrywide unit to pay $1.3 billion in penalties for junk mortgages sold to the government sponsored enterprises in the years prior to the 2008 financial crisis, Bloomberg is reporting.

The amount was a little more than half of what the government had sought.

U.S. District Judge Jed Rakoff in Manhattan  issued the civil penalty against the Charlotte, North Carolina-based bank today in the first mortgage-fraud case brought by the federal government to go to trial.

Countrywide and Rebecca Mairone, a former executive with the mortgage lender, were found liable by a jury in Manhattan federal court in October for selling thousands of bad loans to the two government-sponsored enterprises. Mairone was ordered to pay $1 million.

While Rakoff didn’t grant the government’s request for the maximum penalty of $2.1 billion, he concluded that Fannie and Freddie paid Countrywide nearly $3 billion for the HSSL loans. The judge reduced the penalty by 43 percent because experts for both sides said more than 57 percent of the loans were of “acceptable quality.”