A big accounting firm whose favorable reports on the failed Lincoln Savings and Loan helped delay the costliest government takeover of a thrift tentatively agreed to pay the government more than $40 million, a source familiar with the case says.

Ernst & Young, one of the world's largest accounting firms, agreed to the payment to settle allegations that its predecessor firm did faulty work for Lincoln, the source said Wednesday.The source, speaking on condition of anonymity, said the agreement was reached with the Resolution Trust Corp., the agency responsible for cleaning up the $500 billion thrift debacle.

But a government spokesman would say only that Ernst & Young is in talks on a possible settlement with the RTC.

"There are discussions taking place between us and Ernst & Young," said Alan Whitney, a spokesman for RTC Chairman L. William Seidman. "Nothing has been agreed upon yet that would be appropriate to announce."

In a report published Wednesday, the Wall Street Journal quoted Seidman as saying a settlement with Ernst & Young was "in the mill."

Mort Meyerson, a spokesman for Ernst & Young at its New York headquarters, said the company would not comment "until a formal announcement of our settlement is made.