UK-based international bank Barclays has agreed a settlement over an investment dispute with German bank HSH Nordbank, which will enable it to avoid an unwanted and potentially expensive court case.

Nordbank, the result of a merger between Landesbank Kiel and Landesbank Hamburg, had been threatening court action over losses it sustained on a debt security investment worth $151 million. On Monday, the two banks revealed that they had amicably resolved the disagreement, although they did not provide any details of the settlement.

In 2000, Landesbank Kiel invested in Barclay’s CDOs, which are packages of debt securities sold by Barclays Capital, the investment banking arm of the UK-based bank. Nordbank had alleged that Barclays misled Landesbank over the nature of the CDOs and that Barclays had mismanaged the investments, resulting in the loss of a significant portion of what was originally invested by the German bank.

The settlement heads off court action that was due to be heard next week.