Barclays Plc chief executive said on Tuesday that he would not have recommended the purchase of Lehman Brothers' core U.S. brokerage business if the deal did not show a gain for Barclays, or at least an even exchange.

We needed to be able to establish to the board and to regulators that there was a buffer between the value of trading assets and trading liabilities, Barclays Chief Executive John Varley testified in U.S. bankruptcy court.

We had to be sure we could have at least capital neutrality, he told U.S. Bankruptcy Judge James Peck.

Judge Peck is being asked to decide whether Lehman's claim that the U.K.'s third-largest bank should pay it as much as $11 billion for an unfair windfall when it acquired parts of the defunct brokerage in September 2008.

Barclays denies the allegation and maintains that it is owed $3 billion which is says Lehman's bankruptcy trustee is withholding.

Varley testified that he had to be certain that Lehman's assets were priced accurately amid the turmoil that followed the bankruptcy of Lehman, the fourth-largest U.S. investment bank on Sept 15, 2008.

I was fixated on the need to make sure that the assets being acquired were being marked at realistic valuations.

ACCUSATORY LETTER

Lehman lawyers introduced a letter from JPMorgan Chase & Co head Jamie Dimon that accused Barclays of misleading the court.

The Bankruptcy Court was told that Barclays Capital was to receive $47.4 billion (not $49.7 billion) in securities and to pay $45.5 billion (not $45 or $45.2 billion) in cash, Dimon wrote. In addition, the Court was told that the reason for the change was a deterioration in market prices, an explanation that we now know to be incorrect.

Varley said the letter's inaccuracies made him groan.

We had counter accusations on a number of other points in this letter, Varley said. I read it and inwardly groaned.

All the accusations in the letter were ultimately addressed, he said.

The trial, held at Manhattan's bankruptcy court for the Southern District of New York, has brought the testimony of the top architects of the Lehman purchase. Judge Peck approved the deal just days after Lehman filed for bankruptcy protection becoming the largest U.S. bankruptcy in history.

Varley said the Lehman deal occurred during the riskiest week in my life.

'DOG'S BREAKFAST'

Earlier on Tuesday, Barclay President Robert Diamond testified as to the difficulty in valuing Lehman's assets.

Barclays was struggling to find (Lehman) securities, he testified. Some had no value on the books, some were more illiquid. It was a real dog's breakfast. There were some issues with marks being old and some marks were fairly current.

Diamond was also asked if the judge had received all information about the valuation of Lehman assets at the September 19, 2008, sales hearing.

I have confidence that the lawyers from all sides presented the information that was necessary for approval, Diamond said. He was not at the sales hearing.

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

(Reporting by Chelsea Emery; editing by Andre Grenon, Leslie Gevirtz)