It used to be that every time a bank sold a mortgage, the county land recording office received a fee. It wasn't much — $30 or so — but then real estate boomed in the 1990s and banks pooled millions of mortgages into securities that investors bought and sold.

One mortgage transaction became a dozen or more, and the tab grew ever larger. So the banks came up with a way around the fees. And now they are fighting to avoid perhaps tens of billions of dollars in penalties that have added up over the years.

In 1997, when the banks' burgeoning business in mortgage securities was clashing with the unwieldy nature of written forms, the industry created its own alternative, an electronic system that would track the ever-changing ownership of home loans.

The banks formed a private company called Mortgage Electronic Registry Systems Inc., or MERS. Its motto: "Process loans, not paperwork." It has registered more than 65 million loans, three out of every five on the market.

MERS' owners are all the big mortgage companies, including Bank of America, Citigroup, Wells Fargo, JPMorgan Chase and GMAC. They are all facing a foreclosure-fraud investigation launched by all 50 state attorneys general, and all took government bailout money after the financial meltdown in 2008.

Counties complained about the lost revenue after MERS was implemented, but they rarely tried to challenge the new way of doing business. Now, three years after the housing crash and two months after allegations that some banks submitted fraudulent documents to foreclosure courts, every aspect of the nation's mortgage machine is under scrutiny.

Two lawyers in Reno, Nev., have filed suit in 17 states alleging that banks cheated counties out of billions of dollars. In Virginia, a lawmaker has asked the state's attorney general to investigate MERS over its failure to pay recording fees. And everywhere elected officials and class-action lawyers turn, the back-office procedures of MERS are being called into question.

The lawsuits challenge MERS' authority to act on behalf of banks or other investors that own a mortgage. With so many loans registered to MERS, it's a claim that goes to the heart of the mortgage-fraud scandal.

With MERS ostensibly keeping track of who owns what, counties still get their paperwork and fees the first time a mortgage is filed. Typically, that county fee is rolled into the closing costs homeowners pay when they buy a new home.

MERS is "an admitted fee-avoidance scheme," says Robert Hager, the Nevada lawyer who, along with his partner Treva Hearne, is filing the suits against MERS and its bank owners, including the government-backed mortgage-finance companies Fannie Mae and Freddie Mac. Fannie and Freddie provide a low-cost flow of funding to the nation's mortgage markets by buying mortgages from lenders, packaging them into securities and then selling them to investors.

The suits were filed in California, Nevada and Tennessee and 14 undisclosed states where the cases are still under court seal. Hager and Hearne chose the states because their laws allow what are called false claims suits, in which citizens can take legal action against companies that may have cheated the government.

The suits allege that by privatizing public records, MERS enabled banks to circumvent American property law and bypass the counties' fee and paperwork requirements, costing billions of dollars in lost revenue over more than a decade. MERS says its process is legal, and that the fees are not required under its system.

"These are local fees for service; if no service is needed or requested, no fee is appropriate," MERS spokeswoman Karmela Lejarde said in an e-mail.

Assuming each mortgage it tracks had been resold, and re-recorded, just once, MERS would have saved the industry $2.4 billion in recording costs, R.K. Arnold, the firm's chief executive officer, testified in 2009. It's not unusual for a mortgage to be resold a dozen times or more.

The California suit alone could cost MERS $60 billion to $120 billion in damages and penalties from unpaid recording fees.

The liabilities are astronomical because, according to laws in California and many other states, penalties between $5,000 and $10,000 can be imposed each time a recording fee went unpaid. Because the suits are filed as false claims, the law stipulates that the penalties can then be tripled.

When MERS was created, some county recorders recognized the potential for lost revenue. "It smelled like it could be a scam from hell," said Gary Ott, the county recorder in Salt Lake County, Utah.

From the beginning, many county officials were uneasy about the idea. But most were loath, and lacked the resources, to take on the financial industry. Those who did complain to legislators and reporters say they had a hard time getting anyone to take notice.

"People blew whistles, but a lot of people weren't paying attention," says Christopher Peterson, a University of Utah law professor who has written extensively about MERS and has consulted with Hager on the lawsuits in California and Nevada. "It's not like MERS makes good TV."

A few county recorders did take bold stands. In one prominent case, Edward Romaine, then the recorder of deeds for New York's Suffolk County, refused to accept MERS recordings. He argued that not only would the county lose out on fees — $1 million in one year alone — but that MERS failed to even maintain a clear chain of title on a property. He got backing from New York's attorney general.

MERS sued Suffolk County in 2001. The suit went all the way to New York's highest court, where MERS won on appeal. The court found that a county clerk lacks the authority to refuse to record MERS transactions.

MERS, which does business out of a suburban Washington office building, has about 40 employees. But according to the company, it operates by appointing "certifying officers" and "vice presidents" who work for about 3,000 mortgage companies or their vendors, such as law firms, to sign documents on behalf of MERS.

Several of these "officers" have gained infamy as robo-signers who said they signed as many as 1,000 foreclosure affidavits a day without verifying the accuracy of the information. The robo-signers testified in depositions that even though they had been named as executives of MERS, and signed mortgage documents in that capacity, they were given no MERS training, had no idea where MERS was located, had never received compensation from MERS, and had never communicated with MERS in any form.

The lawsuits over county fees are not the first suits to be filed against MERS. As the recession deepened in 2007 and home values plummeted, lawsuits challenging bank foreclosures also alleged that MERS had no legal right to act as a middleman for banks, or other investors, who actually own the mortgage. Recent court documents have shown how mortgage notes are often lost, casting doubt on who actually owns the mortgage and possibly blighting the chain of title on the property. So far, rulings on these challenges have been mixed. But the red flags were enough to cause JPMorgan Chase CEO Jamie Dimon to stop using MERS for foreclosures in 2008.

Legal experts say the new attack, focusing on the issue of county fees, may have a better chance of success than the foreclosure challenges because of the recent revelations about robo-signers and fraudulent foreclosure documents.

County recorders say they're not opposed to moving out of the world of wet ink and into the world of digital tracking. It's that they feel local government should be doing the tracking, not a private entity like MERS.

They also say important principles are at stake.

"We do want to preserve the integrity of our public records. That is our top priority," says Kay Wrucke, recorder in Martin County, Minn. "If it's not in the public record, how can you know whether the title is clear on a home?"