Goldman Sachs faced a looming deadline in July. Under new federal rules, the storied Wall Street bank was required to rid itself of about $6 billion in risky investments, such as stakes in hedge funds, that regulators fear could hamper it during an economic downturn.

But by late last year, Goldman had yet to find a buyer and appealed to the Federal Reserve for a reprieve. The agency gave Goldman and several other banks five more years to comply with the rules put in place in response to the 2008 financial crisis.

Now, it appears, Goldman may be able to keep those investments after all.

Republican lawmakers passed legislation in the House this week that would do away with the requirement all together. It is part of a sweeping plan to ease banking industry rules they argue have been hampering the economy and made it more difficult to get a loan. The effort, backed by the Trump administration, aims to dismantle major portions of the Obama administration’s 2010 financial reform law, known as the Dodd Frank Act, landmark legislation that forced banks to maintain a larger financial cushion and take on less debt.

“Congratulations to Jeb Hensarling & Republicans on successful House vote to repeal major parts of the 2010 Dodd-Frank financial law. GROWTH!,” President Trump said in a tweet Friday morning. (Rep. Hensarling, a Republican from Texas, shepherded the legislation.)

Supporters touted the rules as a chance to help community and regional banks, many of which struggle to comply with a regulatory regime aimed mostly at the biggest banks. But the big banks would also gain relief, and one of the key ways is the proposed elimination of a provision known as the “Volcker rule.”

The rule, named after its chief champion, former Federal Reserve chairman Paul Volcker, has two prongs. The first limits banks’ ability to buy and sell exotic financial instruments, and the second limits the ability of banks to operate and invest in hedge funds and private-equity funds.

Banks that make loans and collect consumer deposits, such as checking and savings accounts, shouldn’t be using that money to take on the same type of risks that hedge funds do, supporters of the rule say. But House Republicans argued that the Volcker has sapped liquidity from the markets — in other words, reduced the number of institutional buyers and sellers — and said in a summary of the legislation that repealing the rule would “promote more resilient capital markets and a more stable financial system.”

To comply, big Wall Street banks have shut down their “proprietary trading” desks to eliminate speculative trades and began selling off their investments in hedge and private equity funds. The shift was particularly significant for Goldman, which once claimed that such proprietary trading accounted for 10 percent of its revenue.

In an CNBC interview earlier this year, Goldman chief executive Lloyd Blankfein said restrictions on bank trading could prevent companies from being involved in the kinds of transactions that are “beneficial to the financial markets. There should be more flexibility.”

Many in the industry complain that the regulations governing the Volcker rule are so complex it made it difficult to distinguish between the financial transactions a bank may do on its own behalf, purely for profit, or on behalf of a client. Jamie Dimon, chief executive of JPMorgan Chase, once warned that “for every trader, we are going to have to have a lawyer, compliance officer, doctor to see what their testosterone levels are, and a shrink — what is your intent?”

Some regulators have acknowledged the complexity of the rules, though critics say banks are exaggerating. “Proprietary trading had banks with conflicts of interest against their customers,” Volcker said in an interview. “The idea that the restraint on proprietary trading is hurting customer service is baloney.”

In the meantime, big banks have received two extensions to comply with aspects of the rule, the first in 2015. The latest covers “illiquid funds,” typically investments banks made in hedge and private funds that may now be difficult to sell.

“I have doubts over the need for an extension. How much of it is just a hope that the rule would go away?,” Volcker said.

The extension gave Goldman more time to rid itself of about $6 billion in investments. Morgan Stanley has applied for more time to deal with about $1.9 billion of such assets.

Citigroup only has about $400 million left and has also been granted an extension. The bank’s chief executive, Michael Corbat, said at a banking conference earlier this month that it was time to make changes to Volcker. “We don’t want to be in the proprietary trading business. We don’t want to be using consumer deposits to speculate,” he said.

But the law is too complex, Corbat said, noting that the rules had been written by five different agencies. Those agencies “have taken the same law, the same rule and applied it five different ways. And what we’ve said is we don’t care which one, just pick one of them. Pick one of them and enforce it that way, and we’d be great with that.”

The House legislation that would repeal the rule all together is unlikely to pass the Senate intact and regulators, who already spent years wiring the rules, may shy away from making significant, time-consuming changes. Treasury Secretary Steven Mnuchin, a former Goldman Sachs banker who has been directed by Trump to make recommendations on improving the banking system, appears to be leaning toward a compromise. “I support the Volcker Rule, but there needs to be proper definition around the Volcker Rule so banks can understand what they can do and what they can’t do,” Mnuchin told the Senate Banking Committee in January.

The effort to repeal or even weaken the rule has outraged some. “The Volcker firewall was among the most critical pieces of Wall Street reform,” said Jeff Merkley (D-Oregon), one of the original sponsors of the provision. “This casino allowed banks to make big bets with taxpayer-insured funds, destabilizing the financial system and the U.S. economy.”

But a repeal of the rule could pay off for big banks. Wall Street banks stand to recoup about $2 billion in profits next year if the trading restrictions were lifted, according to research by Nomura, a global investment bank. That includes a boost of about $446 million for Goldman.