Under the settlement, Lehman will make a one-time cash payment of $767 million to Freddie Mac, Lehman said in a court filing on Wednesday.

The dispute stems from two loans extended to Lehman by Freddie Mac in the months before the bank filed for bankruptcy. Lehman was scheduled to repay the loan on September 15, 2008, the day it filed for the biggest-ever bankruptcy.

Lehman had set aside $1.2 billion to cover the claim as a general unsecured claim, but Freddie Mac argued that the claim should get priority status.

A priority claim would have allowed the government-controlled mortgage agency to be paid before several other creditors.

Once Wall Street's fourth-largest investment bank, Lehman's bankruptcy was a major trigger for the 2008 global financial crisis.

Lehman emerged from Chapter 11 in March 2012 under a plan that could eventually return $65 billion to creditors. The company is winding down, a process expected to take a few years.

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

(Reporting by Tanya Agrawal in Bangalore)