Federal regulators launched a broad legal assault on big banks Friday, claiming they sold nearly $200 billion in fraudulent mortgage investments to housing giants Fannie Mae and Freddie Mac that led to massive losses during the financial crisis.

The suits, brought by the Federal Housing Finance Agency, name 17 domestic and foreign banks as defendants. Among them: Bank of America, J.P. Morgan Chase, Goldman Sachs, Morgan Stanley, Citigroup and Deutsche Bank.

According to the court filings, those firms and others “falsely represented” the quality of the loans that were bundled into securities and sold to investors and “significantly overstated the ability of the borrower to repay their mortgage loans.” The result, the suits claim, were investments that were far riskier than the banks led taxypayer-backed Fannie and Freddie to believe, and the securities ultimately were worth a fraction of their original value.

Friday’s filings in New York and Connecticut represent an escalation in the government’s effort to recoup taxpayer losses incurred during the financial crisis. But the lawsuits also raised questions about the toll they might have on the health of the already struggling banking sector and the prospects for a housing market recovery.

The federal action also underscored the often contradictory relationship between the government and financial firms in the wake of the crisis. At times, government officials have come to the rescue of banks and counted on them to help accelerate the nation’s lagging economic recovery. But often, officials have derided the practices that fueled the financial meltdown and sought to keep banks in check, either through new regulations or negotiated settlements or, as on Friday, potentially costly litigation.

Some financial analysts said the lawsuits come at a particularly bad time because bank lending is already sluggish. They warned that the lawsuits could sap capital from banks, leaving them with even less money to lend, and further weaken the economy. Others argued that Fannie and Freddie were sophisticated investors who helped shape the very securities they purchased.

One former top executive at a financial institution that bought and sold mortgage securities, and who spoke on the condition of anonymity, criticized the suits, saying that “the whole thing has gotten ridiculous and out of hand. The banks are big boys. Fannie Mae and Freddie Mac are big boys. The people who invested in private securities are big boys.”

Added another bank official: “These are folks that were involved in creating these securities. The idea that Fannie and Freddie were victims in this, it defies credibility.”

But James Millstein, a former Treasury official who oversaw the reorganization of bailed-out insurance giant American International Group, said “the anti-fraud provisions of the securities laws don’t have a big boy exemption. There isn’t one rule for little investors and another rule for big investors.”

He added that the government had an obligation to pursue its claims. “I don’t think it’s going to do anybody any good if the price of getting banks to do what they’re supposed to do is giving them a pass on violating the securities laws,” he said, “particularly when it involves an entity currently being subsidized by the taxpayers.”

One factor driving FHFA to act now was the Sept. 8 expiration of the statute of limitations on claims related to securities sold before the government seized Fannie and Freddie three years ago. The FHFA has been negotiating with the banks for months, said people familiar with those talks, but it had to file suit now to protect its claims.

The biggest came against Bank of America and its Merrill Lynch and Countrywide Financial divisions, which together are facing claims on about $57.5 billion worth of securities sold to Fannie and Freddie. After Bank of America, the banks accused of selling the largest totals of allegedly fraudulent securities were J.P. Morgan with $33 billion and Royal Bank of Scotland with $30.4 billion.

Bank of America, whose shares were down more than 8 percent Friday, has been working to bolster its balance sheet by paring assets and building up reserves. Nonetheless, its shares have dropped 45 percent since the beginning of the year, and the company has been battered by other investors seeking billions in mortgage-related claims.

In a statement Friday, the bank argued that Fannie and Freddie previously have acknowledged “that their losses in the mortgaged-backed securities market were due to the unprecedented downturn in housing prices and other economic factors, including sustained high unemployment. Also, they claimed to understand the risks inherent in investing in subprime securities and, in fact, continued to invest heavily in those securities even after their regulator told them they did not have the risk management capabilities to do so.”

The FHFA lawsuits say that the banks routinely assembled mortgage investments using loans that had been singled out as falling short of guidelines. In the case against Countrywide, the regulator cites the example of loans reviewed in 2006 and 2007 by a third party, Clayton Holdings, which found that 26 percent of the residential mortgages fell outside underwriting guidelines. Yet, the FHFA asserts, Countrywide “waived in” 12 percent of the defective mortgages, putting them into a security it then sold to investors.

The FHFA also alleges that Countrywide overstated the percentage of mortgages that were for owner-occupied properties. People are far less likely to default on these kind of loans. In one tranche of securities, Countrywide said that 25.3 percent of the residences were not owner-occupied, but the FHFA said the true figure was 44.8 percent.

The abundance of mortgage-backed securities created by the financial industry during the lead-up to the crisis continues to cost some firms dearly.

A handful of the nation’s largest banks currently are embroiled in settlement negotiations with federal officials and state attorneys general over shoddy foreclosure practices that sparked a national uproar last fall. That potential settlement could cost the banks about $20 billion in penalties and force them to revamp the way they service loans and deal with troubled borrowers seeking to stay in their homes.

Separately, New York Attorney General Eric Schneiderman has undertaken an investigation into the way banks packaged and sold securities in an effort to determine the extent of any wrongdoing.

The FHFA’s actions against the banks aren’t unprecedented. In July, the agency filed a similar suit against UBS Americas Inc. in a federal court in New York, alleging federal securities law violations. The case accuses UBS of misleading investors who bought into pools of loans that had been packed together into mortgage-backed securities. The suit alleges that the company misstated certain facts and omitted others, including information about the creditworthiness of the borrowers and the underwriting practices used in making the loans. UBS has said it will “vigorously” defend the charges.

Fannie and Freddie loaded up on mortgage-backed securities during the years of the housing boom, many of them backed by risky loans, and suffered staggering losses when the real estate market collapsed.

Those losses largely have been plugged with more than $150 billion in federal aid under a deal arranged in September 2008, when the government seized the two firms to keep them from failing.

FHFA is an independent regulator, theoretically insulated from political influence in much the same way as the Federal Reserve. Still, the agency has been under pressure recently from the Obama administration, which has sought new measures to boost the weak housing market. Those ideas include a generous refinancing program that lets struggling borrowers get new mortgages at existing low rates.

So far, the FHFA has proved to be a reluctant partner in those efforts. While initiatives that speed a housing recovery ultimately shore up Fannie and Freddie’s bottom line, they also could cause further losses in the short term. As a regulator, FHFA might prefer the former. As a conservator of Fannie and Freddie in charge of protecting shareholders — who happen to be taxpayers — it has shown deep concern about the latter.

“I think it’s an irresolvable conflict,” Karen Shaw Petrou, managing partner of Federal Financial Analytics, said of the fact that FHFA’s acting chief, Edward DeMarco, must play dual roles as a regulator and a chairman of the board. “It’s like asking [J.P. Morgan Chief Executive] Jamie Dimon to be Ben Bernanke. You don’t, because it’s an inherent conflict.”