Exclusive: The $1.3 billion bond deal haunting Goldman

FORTUNE — The Securities and Exchange Commission is likely to bring charges soon against Goldman Sachs GS for a 2006 mortgage investment deal. The agency hasn’t said which one yet, but Fortune has learned there’s a good chance the SEC’s case will focus on Fremont Home Loan Trust 2006-E, a bundle of more than 5,000 mortgages that has cost investors, including mortgage guarantor Freddie Mac and by extension U.S. taxpayers, an estimated $545 million.

Goldman disclosed that it had recently received a “Wells” notice in a financial filing in late February, a heads-up that the SEC is considering bringing charges. The notice pointed to a $1.3 billion late-2006 mortgage deal. Goldman was the underwriter for nearly 100 mortgage investment deals in the second half of that year, according to a list produced by Dealogic at Fortune’s request, but only the Fremont deal was worth $1.3 billion and met other criteria, such being primarily made up of subprime residential loans.

The SEC has reportedly been looking into what Goldman and other investment banks knew about these loans at the time of the deals and what they told investors. It’s not clear what the SEC will charge Goldman with, if at all. But a recent lawsuit from the government’s Federal Housing Finance Agency brought against Goldman last summer, which involves FHLT 2006-E as well as a number of other mortgage deals underwritten by the firm, alleges that Goldman was regularly told by an outside auditor that many of the loans it had received from Fremont and other brokers were problematic. Nonetheless, the suit alleges, Goldman included many of those loans in FHLT 2006-E and other deals it sold to investors anyway.

If the SEC does sue Goldman, it would potentially be the second time in less than two years that the firm has been charged by the SEC with securities fraud related to a mortgage deal. In 2010, Goldman paid a $550 million fine, the largest in SEC history, to settle charges that it lied to investors when it sold a mortgage related CDO named Abacus. The SEC said it couldn’t confirm or deny what Goldman deal was the focus of the current inquiry. Wells Fargo WFC and J.P. Morgan Chase JPM have also reportedly received “Wells” notices from the SEC related to mortgage deals. Goldman declined to comment.

A dive into FHLT 2006-E is another reminder of just how rotten the piles of loans top Wall Street firms were willing to attach their name to and hawk at the height of the housing bubble. Investors, too, were either holding their noses and handing over their cash, or had just stopped taking the time to sniff these deals altogether. Goldman, for instance, had no trouble selling FHLT 2006-E. It was snapped up by investors even though it paid a yield only slightly more than Treasuries, and was made up mostly of loans to subprime borrowers.

Sergio Pinto was one of those borrowers. Pinto and his wife put down 5% to buy a $1.28 million house, their third, in Carmichael, Calif., in late 2006. No one ever asked Pinto to prove his income, which he says was a combined $200,000 for him and his wife at the time. Two weeks ago, Pinto and his wife moved out of the house for good. Theirs is just one of 2,512 loans in the Goldman deal — more than half of the total — that have either ended up in foreclosure, landed in bankruptcy court, or on which payments are no longer being made. “It was all about ‘We can get you into the house,’ and I wanted in,” says Pinto, 39. “But the payments climbed to $6,000 a month. We just couldn’t afford it anymore.”

Even going by the prospectus Goldman distributed to investors at the time of the offering, the loans in FHLT 2006-E were risky bets. The deal was named after the now-defunct California mortgage brokerage by the same name that made all the loans in the trust. Fremont was known to be among the most lax lenders in the country. According to the original offering documents, 652 of the loans in FHLT 2006-E, or 13%, were made to borrowers with credit scores of 549 or worse – a score that would barely qualify you for a cell phone these days. Nearly 37% of the loans in the trust, or 1,857, were made to borrowers who were never asked to prove their income. More than a quarter of the loans were made to borrowers in California, one of the most overheated real estate markets at the time. Yet, the California loans in Fremont’s portfolio had an average size of more than $330,000 to borrowers with credit scores that on average didn’t break the mid-600s. So perhaps it’s no surprise that, just 12 months after Goldman sold the deal, 32% of the mortgages in the trust had gone bad. Over 350 had entered foreclosure. Borrowers in another 785 mortgages hadn’t made a payment in over a month.

But what makes FHLT 2006-E potentially fraudulent, and why the SEC is likely to sue Goldman, is that it appears the firm knew that even compared to the incredibly low standards it stated it was using to select loans for the deal, the mortgages Goldman actually sold to investors were a good deal worse. For instance, the deal’s prospectus that Goldman assembled and distributed to investors, and filed with the SEC, said that there was only one home loan out of 5,012 in the Fremont trust, or 0.01%, in which a borrower had taken out more than their house was worth. But an audit conducted for the FHFA suit found that at least 1,179 loans in FHLT 2006-E, or 23.5%, were already underwater at the time Goldman was pitching the deal to investors. The suit alleges that Goldman also hid the number of loans in the Fremont trust that were made to real estate investors, which are generally considered riskier than a loan to someone who intends to live in a house themselves. Goldman’s pitch claimed that just under 14% of the loans in FHLT 2006-E were made to investors. In fact, that number was over 24%.

“We found that major financial institutions had information of the defective nature of the loans they were packaging and selling that they never disclosed to investors,” says Phil Angelides, who was the head of the Financial Crisis Inquiry Commission. “It was seminal to the cause of the financial crisis.”