Accredited Home Lenders ( LEND) surged 19% after the struggling subprime lender agreed to meet private-equity buyer Lone Star halfway.

Lone Star agreed to acquire the San Diego lender for $11.75 a share in cash, or $295 million. That's a 22% discount to its original June offer of $15.10 a share, but well above the $8.50 a share Lone Star offered at the end of August after the deal threatened to collapse.

Tuesday's deal price is 20% above Accredited's closing stock price on Tuesday, the firms said. Lone Star has also agreed to inject $49 million into Accredited. Some $34 million of the financing will be used to extinguish outstanding debt from one of the company's creditors. The other $15 million will be used to bolster Accredited's liquidity.

The agreement ends a legal dispute that started after Lone Star tried to walk away from the Accredited buy, citing the sharp decline in the mortgage business. The sides ended up suing one another.

"This new agreement fairly settles our dispute and will expedite the completion of the merger with Lone Star," said Accredited chief James Konrath in Tuesday's release. "We will now turn to the business of rebuilding Accredited for a brighter future with Lone Star."

The news comes as defaults by borrowers with shaky credit histories have scared investors out of the market for mortgage-backed securities. Unable to get market funding, lenders from Countrywide Financial ( CFC) on down have pared back their operations, cut thousands of jobs and recognized steep losses.

If you liked this article you might like

The 10 Best Jobs in America for 2016

20 Best Colleges for Campus Food

10 Consumer Stocks With the Highest Earnings Growth Last Quarter

5 Stocks Dumped by Hedge Funds Last Quarter

15 Most Lucrative Jobs in the Tech Industry