NEW YORK (Reuters) - The top U.S. credit union regulator said on Thursday it had paid more than $1 billion in legal fees to two law firms to pursue lawsuits against various banks over their sales of toxic mortgage-backed securities before the 2008 financial crisis.

The National Credit Union Administration said the contingency fees represented 23.2 percent of the $4.3 billion the agency recovered in settlements with banks over their sale of faulty securities to five credit unions that later failed.

The announcement marked the first time the NCUA had revealed the lawsuits’ costs. NCUA Board Chairman Rick Metsger said the agency previously withheld disclosing its fee arrangements to protect its litigation position and ensure maximum returns.

“Without this fee arrangement, which shifted most of the risk of these legal actions to outside counsel, there would have been no legal investigation of potential claims, no litigation, and no legal recoveries,” Metsger said.

The payouts came after settlements with banks, including Morgan Stanley, MS.N Bank of America Corp,BAC.N JPMorgan Chase & CO JPM.N and Barclays PlcBARC.L. Most recently, last month the NCUA announced a $1.1 billion deal with Royal Bank of Scotland Group PlcRBS.L.

The payouts went to two law firms, Korein Tillery LLC and Kellogg, Huber, Hansen, Todd, Evans & Figel PLLC, which pursued lawsuits against the banks. Neither firm immediately responded to a request for comment on Thursday.

The sum was more than double what another regulator that pursued a similar set of lawsuits against many of the same banks last year said it paid while obtaining an even larger amount of recoveries.

The Federal Housing Finance Agency, which has acted as conservator for mortgage funders Fannie Mae FNMA.PK and Freddie Mac FMCC FMCC.PK since their government takeover in 2008, in September 2015 disclosed paying two other law firms $406.7 million.

The sum, which reflected around 2 percent of the $18.7 billion it obtained through settlements and judgments against 16 banks, has likely grown since then amid ongoing litigation by FHFA against RBS.

The FHFA had no immediate comment on Thursday.