As the housing market came crashing down in 2008, the giant mortgage company Fannie Mae took an unprecedented step to help tackle the rising tide of foreclosures. It named an exclusive group of law firms that would help rapidly carry out the unsavory task of filing legal paperwork to remove homeowners from their homes.

Today, problems with documents handled by firms on Fannie's list - and a similar one created by its smaller rival Freddie Mac - are at the heart of federal and state probes over faulty foreclosure practices that now threaten to further undermine the housing market.

Fannie and Freddie, the largest mortgage companies, shaped the practices being challenged in courtrooms around the country. They picked law firms that could foreclose fast and paid them based on how many foreclosures they could process. Speed was essential because delays cost the companies money - and, after they were taken over by the government two years ago, meant losses for taxpayers, too.

Not only did the companies urge swift foreclosures, but in at least one case Fannie executives also greenlighted working with a firm that they knew firsthand had engaged in legally questionable practices, according to documents and interviews with lawyers and industry officials.

That firm was the Law Offices of David J. Stern in Florida, which built a hundred-million-dollar-plus business foreclosing on the tens of thousands of borrowers who lost their homes in the housing crash.

In 2000, the Fannie executive responsible for overseeing outside law firms in Florida was questioned about Stern's firm in connection with a class-action lawsuit alleging it had charged borrowers bogus fees based on fraudulent paperwork.

In a deposition, Susan Reid, an associate general counsel who oversaw Stern's firm for Fannie until two months ago, was asked by a lawyer representing borrowers why her company hired law firms such as Stern's to handle foreclosures.

"We felt that timelines and the time it took to foreclose on a piece of property . . . could be improved," she responded. She explained that with "every month" that passed, "we're losing money."

Did Fannie, she was then asked, have any safeguards to ensure that law firms, rushing to foreclosure, followed the law? "I don't know of any policies and procedures," she answered.

To the contrary: Fannie and Freddie over the years have prodded law firms and mortgage servicers that collect payments to move even faster.

When law firms or servicers have taken too long to foreclose, Fannie and Freddie have threatened to charge them a penalty fee, according to industry sources and documents. And every few months, the two mortgage companies have sent servicers report cards ranking them on how rapidly they completed foreclosures compared with their peers.

A giant footprint

Fannie and Freddie occupy a unique place in the mortgage world. They are the biggest buyers of pools of home loans, accounting for trillions of dollars of mortgages. These purchases provide an essential source of funding to lenders to make more loans.

Since September 2008, Fannie, based in the District, and Freddie, based in McLean, have also been government-run, seized by federal officials as the financial crisis threatened to topple them. They have cost taxpayers more than $130 billion.

As wards of the state, they have competing imperatives. One is to help borrowers - and the housing market - by modifying the terms of home loans to make them more affordable. The aim is to reduce foreclosures. Another is to protect taxpayer dollars by ensuring that foreclosures don't drag on, causing additional losses.

Both before the government takeover and after, Fannie and Freddie have pressured the outside mortgage servicers they use to work with specific law firms. Although Fannie required servicers to use specific firms, Freddie urged them to do so but didn't demand it.

Florida Attorney General Bill McCollum is examining the relationship between law firms and Fannie and Freddie as part of a broad probe into possible illegalities in the foreclosure process. Other law firms on Fannie's list - in Maryland, New York, Pennsylvania and Texas - have been criticized by judges for their handling of foreclosures, investigated by federal and state authorities for potential wrongdoing or sued by borrowers for mistreating them.

"Given that just a handful of law firms are handling foreclosures for over half the nation's mortgages, it's no wonder this paperwork problem has spread so widely," said Rep. Judy Biggert (R-Ill.), who raised questions about Fannie and Freddie's lawyers a year before the concerns over foreclosure practices broke into public view. "Many Americans may be losing their homes because of a system that was set up to send foreclosures through law firms that were the quickest cheapest and least reliable."

Only in recent months did Fannie and Freddie sever ties with Stern, after reports of abusive foreclosure practices started to surface nationally. The two companies stopped referring new business to the firm in October and started removing cases from it last month.

Stern's attorney, Jeffrey Tew, declined to comment for this article. Stern and his lawyers have said previously that the firm has done nothing improper.

Spokesmen for Fannie and Freddie said the companies have worked to ensure that servicers and law firms have enough time to conduct the foreclosure process properly. The spokesmen say protracted foreclosures not only cost taxpayers but also lead to vacant homes, which degrade the housing stock and nearby home values, and prolong the real estate crisis. They say they tell their law firms and servicers to focus on modifying mortgages for troubled borrowers when possible and to foreclose in a timely fashion when it's not.

"At all times, Fannie Mae has had a reasonable expectation that our servicers and the law firms adhere to proper procedures and conduct under the law," said Amy Bonitatibus, a Fannie Mae spokeswoman. "When allegations regarding the Stern firm came to our attention, we promptly investigated and took appropriate responsive action."

Prompted by the surge of foreclosures in Florida, Fannie Mae hired a consultant this year to audit Florida law firms. These examinations did not discover evidence of abuses in the foreclosure process.

Sharon McHale, a Freddie Mac spokeswoman, said there is no rush to foreclose when homeowners default on its loans, noting that borrowers must be delinquent for at least 300 days before a foreclosure sale can take place.

"We incent our servicers to find ways to help borrowers avoid foreclosure and give them ample time to do so," she said. "Servicers have the authority to stop the process anytime there is a viable alternative to foreclosure."

Early warning signs

But Fannie's relationship with Stern, in particular, highlights the mortgage giant's complicated role in the foreclosure crisis.

Florida homeowners first raised a red flag about Stern in their 1998 class-action lawsuit.

Claude Walker, a lawyer who represented them, said Fannie ignored their complaints. "They wanted to get these foreclosures through the process as fast as possible. That was their goal."

Fannie officials held an internal discussion in 1999 about the issues posed by the lawsuit, Reid said in the deposition. As Fannie's in-house lawyer, Reid said she was primarily concerned with whether Fannie might also be sued. She said neither she nor anyone else at Fannie investigated the allegations made in the lawsuit.

Reid declined to comment on the deposition for this article.

Still impressed with Stern, Fannie named Stern its "lawyer of the year" in 1998 and 1999, according to the law firm's filings with the Securities and Exchange Commission. A Fannie spokeswoman said she had no details but did not dispute the account.

In 2000, Stern paid $2.2 million to settle the class-action lawsuit. He was also reprimanded by the Florida Bar in 2002 for his firm's questionable conduct.

For a time, according to one industry source, Fannie distanced itself from Stern, concerned about whether it would face legal liabilities. But Stern continued to work to nurture his relationship with Fannie, Freddie and the servicers who managed loans for the companies.

And when the mortgage crisis struck, Stern was well placed to get a spot on Fannie Mae's coveted list of lawyers that servicers must use to foreclose.

Stern's foreclosure caseloads jumped from nearly 15,000 in 2006 to 70,400 last year. Total firm revenue, which included foreclosures and related work, swelled from $41 million to $260 million annually by the end of last year, according to a filing made in connection with an effort to raise money from investors.

Stern focused on tending to the needs of Fannie and Freddie, depositions with Stern's former employees show.

"Freddie Mac and Fannie Mae were number one for his firm," Kelly Scott, a former Stern employee, said in a deposition with the Florida attorney general. "David Stern had a very close relationship with Freddie Mac and Fannie Mae."

Seven or eight times in 2008, Fannie and Freddie employees came to Stern's firm to review the files. Stern arranged for their hotels, catered lunches and chauffeuring, and picked up some of those expenses, according to Scott.

Fannie and Freddie had a singular message for Stern's firm, Scott said: "Pick up the speed." She said Stern told his employees working on Fannie and Freddie cases "they need to pump out as much as they can for the month so they can meet the quota." She said that she didn't know what the quota was but that it was clear that Fannie and Freddie "weren't happy" with the progress.

Fannie and Freddie officials said in interviews that they did not pressure Stern to rush foreclosures and in fact imposed a general freeze on foreclosures in late 2008 through early 2009. The officials also said employees covered their own expenses when visiting Stern's firm and went there every few months, at most.

Still, though, through this year Fannie continued pressing firms to foreclose. In a memo dated Aug. 31, Fannie Mae warned mortgage servicers that fees may be imposed based on "the length of the delay and any costs that are directly attributable to the delay."

But Freddie was having second thoughts. It was hearing from one of its loan servicers, Ally Financial, that there were problems in the paperwork Stern's firm was using to foreclose on loans Freddie owned. So Freddie urged Ally Financial and other servicers to suspend all foreclosures being handled by Stern.

On Sept. 20, Ally Financial suspended foreclosures in about half the states, with Stern's firm and others. Other major mortgage companies soon followed suit.

A few days later, Rep. Alan Grayson (D-Fla.) wrote to Fannie, asking, "Why is Fannie Mae using lawyers that are accused of regularly engaging in fraud to kick people out of their homes?"

About two weeks after that, Fannie stopped sending new cases to Stern.