JP Morgan Chase, Bank of America and Wells Fargo are being sued by the US Attorney General over an allegedly restrictive and inaccurate database that may have resulted in unfair foreclosures for many home buyers.

The banks, which are some of the largest in America, are accused of creating and controlling access to a database of mortgage holders in ways that enabled them to deceive courts and fraudulently foreclose homes for people struggling to pay their mortgage. At the same time, they avoided $2 billion in processing fees. They have not yet commented on the claims.

The electronic mortgage registry, known as MERS, was created in 1995 to simplify the recording of mortgage sales and to allow banks to more easily sell on the loans. The system was created in 1995, and contains 70 million loans, including those written by Fannie Mae and Freddie Mac. Nearly half of the loans in the system are currently active.

But as well as being used fraudulently, the database was also "plagued with inaccuracies and errors", according to the complaint.

US Attorney General Eric Schneidermann said that employees and agents of the bank used the system to "repeatedly" submit court documents on mortgage holders, "containing false and misleading information that made it appear that the foreclosing party had the authority to bring a case when in fact it may not have [had]".

A large number of the 13,000 foreclosure filings in court, based on the system's data, were invalid because they misrepresented the claimants as having the authority to foreclose, said the lawsuit. The system even automatically generated erroneous documents that only served to mislead and confuse homeowners and the courts, it said.

Merscorp, the company created to run the system, is also named alongside the three banks in the lawsuit, as well as the bank's loan subsidiaries BAC Home Loans Servicing, Chase Home Finance, EMC Mortgage Corporation, and Wells Fargo Home Mortgage.

The MERS system stored information in a private database, which "effectively eliminated homeowners' and the public's ability to track property transfers through the traditional public records system," according to the Attorney General's office.

"The banks created the MERS system as an end-run around the property recording system, to facilitate the rapid securitisation and sale of mortgages," said Schneiderman.

"Once the mortgages went sour, these same banks brought foreclosure proceedings en masse based on deceptive and fraudulent court submissions, seeking to take homes away from people with little regard for basic legal requirements or the rule of law."

The lawsuit is intended to show that there is "one set of rules for all, no matter how big or powerful the institution may be," he said.

It calls for damages, if won, to be calculated according to all the fees and profits allegedly fraudulently collected, as well as for a $5,000 payment to the state for each instance of law breaking. The lawsuit also asks the judge for a court order to resolve any incorrect foreclosures as a result of MERS.

Meanwhile, the banks are looking to sign a $25 billion nationwide agreement with the US government, which could release them from further liability over unfair foreclosures. It remains unclear to what extent that agreement could be blocked by the lawsuit.