Photograph by Colin Robertson at The Truth About Mortgage

A New York state judge handed Bank of America (NYSE:BAC) its second major legal victory since the beginning of the year.

Justice Saliann Scarpulla ruled this week that the nation's second largest bank by assets can go forward with an $8.5 billion settlement it reached with institutional investors including Blackrock (NYSE:BLK) and MetLife (NYSE:MET) in June of 2011.

American International Group (NYSE:AIG) had challenged the deal, which was approved in January by a former colleague of Justice Scarpulla's, on the grounds that it didn't adequately compensate investors for losses sustained from mortgage-backed securities issued by Countrywide Financial, which Bank of America acquired on the eve of the financial crisis.

The insurance giant's arguments, however, were dismissed by the court.

Proponents of the deal have speculated AIG was using the proceedings simply to gain leverage in a related securities fraud case it's litigating against Bank of America in California. "The court should not permit AIG to nullify the judgment and hold the entire settlement hostage indefinitely," supporters argued.

For its part, AIG adamantly opposed this characterization, arguing in an official filing that the previous judge "repeatedly refused to give any weight to Petitioners' claims that AIG was merely leveraging its objection to benefit its separate securities fraud claim, and Petitioners presented no such evidence at the hearing."

Either way, for the time being at least, the $8.5 billion settlement appears to be well on its way to consummation.

The news should further lift the cloud of legal uncertainty from Bank of America's stock, leaving only a handful of securities fraud actions pending in California as well as a future settlement with the government akin to JPMorgan Chase's 2013 deal with various federal agencies.