Several visits over months by the bank’s well-connected chief executive, Jamie Dimon, and his top aides were aimed at persuading regulators to create a loophole in the law, known as the Volcker Rule. The rule was designed by Congress to limit the very kind of proprietary trading that JPMorgan was seeking.

Even after the official draft of the Volcker Rule regulations was released last October, JPMorgan and other banks continued their full-court press to avoid limits.

In early February, a group of JPMorgan executives met with Federal Reserve officials and warned that anything but a loose interpretation of the trading ban would hurt the bank’s hedging activities, according to a person with knowledge of the meeting. In the past, the bank argued that it needed to hedge risk stemming from its large retail banking business, but it has also said that it supported portions of the Volcker Rule.

In the February meeting was Ina Drew, the head of JPMorgan’s chief investment office, the unit that suffered the $2 billion loss.

JPMorgan officials declined to comment for this article. But in the company’s annual report, Mr. Dimon wrote: “If the intent of the Volcker Rule was to eliminate pure proprietary trading and to ensure that market making is done in a way that won’t jeopardize a financial institution, we agree.”

He added: “We, however, do disagree with some of the proposed specifics because we think they could have huge negative unintended consequences for American competitiveness and economic growth.”

JPMorgan wasn’t the only large institution making a special plea, but it stood out because of Mr. Dimon’s prominence as a skilled Washington operator and because of his bank’s nearly unblemished record during the financial crisis.

“JPMorgan was the one that made the strongest arguments to allow hedging, and specifically to allow this type of portfolio hedging,” said a former Treasury official who was present during the Dodd-Frank debates.

Those efforts produced “a big enough loophole that a Mack truck could drive right through it,” Senator Carl Levin, the Michigan Democrat who co-wrote the legislation that led to the Volcker Rule, said Friday after the disclosure of the JPMorgan loss.

The loophole is known as portfolio hedging, a strategy that essentially allows banks to view an investment portfolio as a whole and take actions to offset the risks of the entire portfolio. That contrasts with the traditional definition of hedging, which matches an individual security or trading position with an inversely related investment — so when one goes up, the other goes down.

Portfolio hedging “is a license to do pretty much anything,” Mr. Levin said. He and Senator Jeff Merkley, an Oregon Democrat who worked on the law with Mr.

Levin, sent a letter to regulators in February, making clear that hedging on that scale was not their intention.

“There is no statutory basis to support the proposed portfolio hedging language,” they wrote, “nor is there anything in the legislative history to suggest that it should be allowed.”

While the banks lobbied furiously, they were in some ways pushing on an open door. Officials at the Treasury Department and the Federal Reserve, the main overseer of the banks, as well as the Comptroller of the Currency, also wanted a loose set of restrictions, according to people who took part in the drafting of the Volcker Rule who spoke on the condition of anonymity because no regulatory agencies would officially talk about the rule on Friday.

The Fed and the Treasury’s views prevailed in the face of opposition from both the Securities and Exchange Commission and the Commodity Futures Trading Commission, which regulate markets and companies’ reporting of their financial positions. Both commissions and the Federal Deposit Insurance Corporation, which insures bank deposits, pushed for tighter restrictions, the people said.

Even some of those who have said the Volcker Rule is fatally flawed agree that, in its current form, the rule would have allowed JPMorgan Chase to do what it did.

“Would the Dodd-Frank law have stopped this?” asked Peter J. Wallison, a fellow in financial policy studies at the American Enterprise Institute, who has been a consistent critic of the postfinancial crisis reforms. “No,” he answered. “Dodd-Frank specifically allows hedging and market-making transactions.”

The Volcker Rule was not intended to offer such a broad exemption to the ban on proprietary trading. People involved with the drafting of the Dodd-Frank law itself say that the authors fought repeatedly to tighten the language, in part to specifically exclude portfolio hedging.

In its earliest form, the Merkley-Levin amendment to the Dodd-Frank regulatory law said that any “risk-mitigating hedging activity” — or hedging positions that reduced a bank’s risk — would be allowed. Through several drafts, that exception was steadily narrowed. The final law permitted only hedges tied to specific investments.