The partners at the law firm of Quinn Emanuel Urquhart & Sullivan concluded a few years ago, before the financial crisis, that there was simply too much competition for representing major banks.

So they decided to find some elbow room. The Los Angeles-based company would get out of the business of representing big banks and accounting firms and gear the work toward companies suing those institutions.

“There weren’t many, if any, prestigious law firms who were willing to be adverse to these global financial firms,” said William Urquhart, a partner at Quinn Emanuel.

After the nation’s housing bust, the opportunity turned out to be bigger and more lucrative than he and his colleagues realized.

This month, Quinn Emanuel filed more than a dozen of the 17 lawsuits that federal regulators brought against foreign and domestic banks, claiming they had sold nearly $200 billion in fraudulent mortgage investments to housing giants Fannie Mae and Freddie Mac.

The troubled home loans that banks bundled into securities and sold to investors in the years before the financial crisis have tanked in value. Amid that wreckage has arisen a wave of lawsuits in the past few years that claim banks misled customers and portrayed the investments as far less risky than they turned out to be. Many firms that specialize in banking and securities law, including some of the country’s most prestigious names, have been unwilling or unable to take these cases because the banks are their clients.

Quinn Emanuel and a handful of other firms nationwide with expertise in these complex areas and the means to take on financial behemoths have flourished as the legal wrangling over those soured deals continues. The Federal Housing Finance Agency, which regulates Fannie and Freddie, sought out Quinn Emanuel to handle the lawsuits against 17 banks.

Lawyers for plaintiffs and defendants alike are benefiting from the increasingly litigious fights between investors and Wall Street firms over the shoddy mortgage-backed securities that fueled the housing boom and exacerbated the bust that followed.

It’s unclear how much the outside firms working on the FHFA suits stand to make from the cases and how much taxpayers will be charged for the work. The FHFA declined to comment for this article, and lawyers at Quinn Emanuel declined to discuss particulars of their work with the government.

What is certain is that Fannie and Freddie have made a lot of money for many lawyers since the government seized the mortgage giants three years ago to prevent them from failing. As of earlier this year, the two mortgage finance companies had spent $160 million to defend themselves and their former executives in lawsuits and $50 million on foreclosure lawyers now under investigation in Florida.

The other FHFA lawsuits filed this month were handled by Kasowitz Benson Torres & Friedman, which long ago decided to switch gears and work against, rather than for, big banks. Beginning in the 1990s, the firm began representing groups of creditors in high-profile bankruptcy cases, such as Enron and WorldCom. In the wake of the crisis, that work increasingly has included suits involving mortgage securities.

“When the subprime crisis hit and the economy began to freeze up, we had a couple lawyers dedicate themselves to studying the structured finance products that were at the heart” of the collapse, partner Marc Kasowitz said. “When the litigation began, we were pretty well positioned and up to speed.”

The FHFA litigation was a good fit for Quinn Emanuel because of its previous tanglings with big banks. The firm is leading a similar suit that the agency filed in July against the Swiss bank UBS over mortgage securities.

Quinn Emanuel has also represented bond insurer MBIA in massive mortgage-backed securities claims against Bank of America and its Countrywide unit. This spring, the firm brought multiple mortgage-related suits on behalf of insurer MassMutual against the likes of Goldman Sachs and other large banks.

“In 2008, we started to see all these financial products blowing up,” said Michael Carlinsky, a Quinn Emanuel partner who is the lead lawyer on a $10 billion suit the firm recently filed on behalf of insurer American International Group against Bank of America over mortgage securities. “We had the expertise when all of a sudden these [deals] were going into litigation in such a huge, huge way,” he said.

A trio of the firm’s New York-based partners, who head its 100-person structured finance group, have dug into mountains of legal contracts and prospectuses that govern the world of mortgage-backed securities. The firm also carried out intense training courses for new associates to help them better understand the technical and legal complexities of how mortgages are turned into securities.

Carlinsky said the recent uptick in securities cases has come in part because statutes of limitations are expiring and investors are eager to try to recoup their losses.

The phone keeps ringing.

“The truth is, it just keeps growing,” he said. “There’s been no letup.”