A federal appeals court Monday ruled in favor of Bank of America, reversing a lower court ruling. The decision is a blow to the federal government, which had won the case at trial. Bank of America had been ordered to pay a $1.27 billion penalty for alleged violations by its Countrywide unit.

The case got attention in 2012 because it appeared to pull back the curtain on some of the widespread wrongdoing in the mortgage industry that led to the worst financial crisis in generations.

The "Hustle" case, as it was called, involved a whistleblower, a senior executive from Countrywide, who said the bank continued to make risky loans and sell them to investors even after the housing market was starting to fall apart.

The alleged wrongdoing in the case occurred in 2007 when Countrywide was the biggest home lender in the U.S. and there were growing defaults on risky loans such as the so-called liars loans — where borrowers didn't even have to show proof of their income to get a mortgage.

But rather than be more cautious and dial back its risky lending, prosecutors alleged that Countrywide gutted its quality control system so it could push sketchy loans through the pipeline three times faster than before. The lawsuit says that Countrywide ignored warnings that the loans were going bad and kept making more of them and selling them to investors anyway. This program within the bank to keep making these bad loans was allegedly referred to by executives at the bank as "The Hustle."

During the trial, defense attorneys said the lawsuit was misguided and that the whistleblower had a grudge.

And now, a federal appeals court is siding with the bank. The appeals panel says that the government didn't prove that the bank had intended to commit fraud when it sold packages of home loans to investors.

Copyright 2016 NPR. To see more, visit http://www.npr.org/.