JPMorgan Chase said Wednesday it struck a $3.5 billion deal to sell its physical commodities business to Swiss trading firm Mercuria Energy Group, a move that comes as regulators question the risks of banks influencing commodities prices and exposing themselves to potential damage from unstable markets.

The sale marks a reversal from a ­two-decade trend toward greater involvement of financial institutions in commodity markets, with banks not only assisting clients but also trading for their own accounts. Buying up physical assets such as storage tanks gave investment banks the flexibility to accept delivery of and hold on to commodities such as oil, sugar, corn and metals.

Those moves alarmed consumer groups, lawmakers and some regulators. Now, after a series of costly settlements over government charges of market ma­nipu­la­tion, big banks are shedding their stakes in warehouses and oil tank farms and returning to a more scaled-down business model.

Wednesday’s sale, which is subject to regulatory approval, would bring JPMorgan back to basics. The bank said it will continue to provide “traditional banking activities in the commodities markets, including financial products and the [storing] and trading of precious metals.”

JPMorgan had been shopping around its commodities unit since last summer and held meetings with a number of potential buyers, including Blackstone and Australia’s Macquarie, according to a person familiar with the matter who was not authorized to speak publicly.

Talks with Mercuria, one of the largest independent commodities traders, began to heat up early last month. The deal will give the Swiss company energy assets across North America, as well as a metal-warehouse operator, Henry Bath & Son, in Britain.

“Our goal from the outset was to find a buyer that was interested in preserving the value of JPMorgan’s physical business,” Blythe Masters, head of the JPMorgan commodities unit, said in a statement. “Mercuria is a global leader in the commodities markets and an excellent long-term home for these businesses.”

It is unclear what will become of Masters and her staff. A person familiar with the sale said Mercuria has been interviewing JPMorgan employees and plans to make job offers before the deal closes in the third quarter.

A controversial figure, Masters is widely credited as an architect of the notorious credit default swaps that helped fuel the financial crisis. Her contribution and ascension into the top ranks of JPMorgan raised her profile on Wall Street.

But Masters’s star was dimmed in July when the Federal Energy Regulatory Commission slapped JPMorgan with a $410 million penalty over allegations that it manipulated energy markets. The agency did not pursue charges against Masters, but evidence in the case cast her in a poor light.

The commission produced e-mails that showed Masters may have been aware of bidding strategies the firm used to charge electricity grids in California and the Midwest as much as 80 times the prevailing power prices. Days before the settlement became public, JPMorgan announced its intentions to exit the physical commodities business.

Analysts say the decision came as little surprise, since many investment banks are entertaining sales of their physical assets in anticipation of new restrictions from the Federal Reserve.

The central bank has been reviewing a 2003 rule that let commercial banks engage in commodity trading activities that were deemed complementary to their financial activities. The rule allowed bank holding companies to own physical commodity assets such as oil pipelines at the same time they traded oil on the markets.

As the Fed began contemplating new restrictions over the summer, the Commodity Futures Trading Commission launched a probe into irregularities in the aluminum market and subpoenaed metal-warehouse owners, including Goldman Sachs, according to a person familiar with the investigation.

By December, Morgan Stanley had sold its physical oil business to Russia’s Rosneft, while Deutsche Bank announced plans to bow out of its commodities assets around the world. Goldman has also been entertaining a sale of its warehouse business.

“This is a sign of the times of the industry and regulation,” said Daniel Marchon, an analyst at Raymond James & Associates. “If you look at the revenue impact versus the continuing mounting costs on the regulatory front, it doesn’t make sense to stay in this business.”

There has been a long-standing debate over the merits of investment banks’ involvement in commodity markets.

Some economists say banks provide liquidity that makes it easier for airlines and farmers to hedge prices and avoid sharp price swings that could threaten their businesses. Others argue that the massive amounts of money invested by big banks distort the commodity markets and can drive up prices.

One critic of the arrangement, Sen. Sherrod Brown (D-Ohio), called JPMorgan’s sale of its unit “a welcome development.” In an e-mail, he stressed that the decision does not let regulators off the hook.

“The Fed, CFTC, and others must enact robust reforms to Wall Street’s physical commodities activities and do more to protect end users and consumers of aluminum and other materials,” he said.