A bankruptcy judge has denied Lehman Brothers Holdings Inc's attempt to recover from Barclays Plc $500 million it alleges was supposed to go toward employee bonuses.

In a ruling lodged Wednesday in U.S. Bankruptcy Court in Manhattan, Judge James Peck denied Lehman's bid for a judgment forcing Barclays to pay it back $500 million in bonuses for Lehman employees it inherited when it bought Lehman's North American brokerage in 2008. Lehman said Barclays never gave the money to the employees and should send it back to Lehman for the benefit of Lehman's creditors.

The Lehman bankruptcy, with $639 billion in assets, was by far the largest in U.S. history and a major catalyst of the financial crisis. The sale of its North American business to Barclays, completed quickly in the days following the bankruptcy, has been the subject of long-lasting litigation.

Lehman earlier tried to invalidate the sale, saying Barclays secured an $11 billion windfall by withholding information from the court. Judge Peck upheld the sale in February.

Wednesday's ruling is the latest instance of validation for Barclays, which maintained that it did not breach the terms of the sale deal on the issue of employee bonuses.

Today's decision importantly confirms that Barclays acted in good faith in its dealings with Lehman, just as the court held in its February decision rejecting Lehman's effort to modify the sale order, Barclays attorney Jonathan Schiller said in a statement.

Lehman had asserted that Barclays agreed to pay inherited employees $2 billion in bonuses, but paid only $1.5 billion. If the money was not used for bonuses, Lehman argued, it should go back to the Lehman for creditor payouts.

Barclays said the $2 billion figure was an estimate rather than a hard number, and that it had paid nearly the full $2 billion if other forms of compensation, like severance, are included. The judge agreed with Barclays, calling Lehman's motion baseless.

The parties engaged in a process to estimate the overall exposure for these liabilities but never agreed on a definitive single number for bonus compensation, Peck said.

He added that Lehman was misguided in its assertion that the court had accepted as fact that the sides had agreed to a set figure.

A Lehman spokeswoman declined to comment on the ruling and on whether Lehman plans to appeal. The company has appealed Peck's February ruling upholding the overall sale.

The case is In re Lehman Brothers Holdings Inc, U.S. Bankruptcy Court, Southern District of New York, No. 08-13555.

(Reporting by Nick Brown, editing by Matthew Lewis)