Bank of America Corp. has agreed to pay $1.6 billion in cash to MBIA Inc. and will receive the right to buy a 4.9 percent stake in the bond insurer to resolve long-running litigation, the companies said on Monday.

Bank of America will also remit $137 million worth of MBIA senior debt it acquired in December and provide MBIA with a $500 million credit line as part of the deal.

The accord will settle all of the two companies’ disputes, including liability for MBIA as a counterparty in swap deals with Bank of America. Bank of America will take a charge against previously reported first-quarter earnings and its capital ratios will rise under Basel III as a result of the deal.

MBIA shares rose as much as 57 percent on the news. By the close, the shares were up 45 percent, at $14.29, while Bank of America shares closed up 5.2 percent at $12.88.

The settlement marks Bank of America Chief Executive Brian Moynihan’s latest step to fix wide-ranging litigation related to the financial crisis and relieves investor fears that MBIA might face liquidation over the bank’s claims.

In a statement, MBIA Chief Executive Jay Brown called the deal a “significant milestone” for the company, which is in the process of restructuring itself and risked running out of money within months if it had not settled the Bank of America dispute.

“I think Bank of America was able to put some pressure on and extract some clear leverage from the fact that MBIA looked to be on the brink,” said attorney Don Hawthorne, a partner at Axinn, Veltrop & Harkrider who has represented clients in mortgage-backed securities litigation.

“It’s probably a good deal all around,” he added, reflecting that “MBIA obviously had a strong case and Bank of America had a strong negotiating position.”

MBIA had long been in the sleepy business of guaranteeing municipal debt against default, but last decade it began guaranteeing riskier structured bonds, such as repackaged mortgage securities, in a bid to add revenue and profit.

That backfired as MBIA lost its top credit ratings and banks sought to hold it liable for losses after the housing bubble burst. Short sellers such as hedge fund manager William Ackman argued MBIA lacked capital to cover structured finance losses.

To survive, MBIA won approval in 2009 from New York’s insurance regulator, now part of the state’s Department of Financial Services, to split into a municipal bond insurer to underwrite new deals and a guarantor of structured finance products that would handle old claims.

But 18 banks objected, saying it would leave MBIA insolvent and unable to pay its mortgage-related claims.

Monday’s settlement leaves Societe Generale as the only bank still in that case. A spokesman did not immediately respond to a request for comment.

Avoiding Liquidation

In a statement, Benjamin Lawsky, New York’s financial services superintendent, said the deal was reached after more than a year of negotiations. He called it “a very positive step forward for both Bank of America and MBIA.”

The deal came together after MBIA’s board hired Blackstone Group LP as an adviser, said a person familiar with the matter, who was not authorized to discuss it publicly. A Blackstone spokesperson did not immediately respond to a request for comment on their role.

MBIA’s structured finance unit could have been forced into liquidation or rehabilitation had the Bank of America case continued, the insurer said on Feb. 27. Brown said that month that there was a “significant risk” of a regulatory proceeding.

In 2011, the municipal bond guarantee business lent $1.1 billion to the structured finance unit to fund settlements with bond buyers, debt that over time grew to be $1.7 billion. But the company’s regulator refused to allow the structured finance unit to borrow more.

MBIA will use proceeds from the Bank of America deal to repay that loan, which stood at $1.6 billion as of May 2, following a $110 million payment from a separate settlement with Flagstar Bancorp Inc.

More Legal Woes

As part of the accord, Bank of America will receive warrants to purchase 9.94 million shares of MBIA, or roughly 4.9 percent of its outstanding stock, at a price of $9.59 per share. The warrants can be exercised any time prior to May 2018.

Some investors saw Bank of America taking an equity stake as a sign of confidence in MBIA’s future.

Bank of America will take a charge of $1.5 billion, or 10 cents per diluted share, after taxes related to the settlement, slicing its previously reported earnings per share in half. Accounting standards dictate that it take the charge against first-quarter earnings because it has not yet filed its 10-Q report, Bank of America said.

The bank’s Tier 1 capital ratio under Basel III standards will rise by 10 basis points to 9.52 percent to reflect a reduction in risk-weighted assets related to the MBIA swaps being canceled. Its tangible book value per common share will drop by 10 cents to $13.36.

The MBIA deal is just the latest settlement Bank of America has reached to resolve crisis-era litigation.

Last month, the bank reached a $500 million settlement with investors who claimed they were misled by its Countrywide unit into buying risky mortgage debt. The second-largest U.S. bank still faces litigation by the Federal Housing Finance Agency on behalf of Fannie Mae and Freddie Mac, and by insurer American International Group Inc.

Bank of America is also awaiting court approval of an $8.5 billion deal reached with investors in Countrywide mortgage-backed securities. A hearing is scheduled to begin May 30.

On Friday, the New York and Delaware attorneys general dropped their objections to the deal. AIG and other parties remain opposed.

“I don’t think anyone’s going to ever at this point declare victory,” Bank of America Chief Financial Officer Bruce Thompson said on a conference call last month. “We’re moving through in a pretty meaningful way this pipeline of items.”

News of the Bank of America-MBIA settlement was first reported by Dow Jones.