LONDON—The war in Ukraine broke the nickel market. The risks had been building for years.

Banks and brokers lent heavily to producers and speculators eager to take a position on the humble metal, a key ingredient in stainless steel and electric-vehicle batteries. 

The exchange in London where metals have traded for 145 years failed to see the mounting danger.

“The simple fact here is that we did not have visibility over the size of the risk,” said Matthew Chamberlain, the London Metal Exchange’s chief executive.

The LME’s response to the crisis threatens its dominant position in the global metal market. It dallied when nickel trading spiraled out of control on March 7, then suspended the market and wiped out $3.9 billion in transactions the next morning, infuriating traders who had bet on nickel’s price rise.

SHARE YOUR THOUGHTS

Will the LME be able to rein in nickel-price moves and protect its members?

The shutdown left nickel companies rudderless for over a week before limited and chaotic trading activity resumed on Wednesday. The market has been glitchy, with prices falling to the LME’s freshly imposed daily limits. Some trades went through below those levels, including early Friday, leading the LME to cancel more transactions.

“This sort of behavior in a market diminishes its appeal as a free market and as a global pricing mechanism,” said Michael Farmer, a hedge-fund manager known as Mr. Copper.

Nickel’s blowup ricocheted through markets. Tsingshan Holding Group, the Chinese nickel maker at the heart of the crisis, owed a collection of banks and brokers $4.5 billion for margin payments related to its trade after the LME scrapped nickel trades made on March 8, people familiar with talks between the lenders said. The amount of exposure to the banks hasn’t been previously reported. 

A worker separates nickel ore from other elements at a processing plant.

Photo: Yusuf Ahmad/REUTERS

The banks, led by JPMorgan Chase & Co., and including Standard Chartered PLC, BNP Paribas SA and several Chinese banks, are in talks to refinance the trade to prevent further damage. Spokespeople for JPMorgan, Standard Chartered and BNP Paribas declined to comment.

In an illustration of how out of control the market had become, had the London Metal Exchange not canceled hours worth of trades and allowed prices to stand at over $100,000 a metric ton, Tsingshan would have owed the group an estimated $15 billion, a person familiar with the trades said.

When Russia, one of the world’s largest nickel suppliers, invaded Ukraine, prices of the metal surged on worries about supply disruptions. That caused Tsingshan’s positions in the nickel market to shed billions of dollars. Some of the Chinese producer’s brokers at the LME furiously tried to exit from the positions by buying nickel, creating a squeeze. 

Only 20% of Tsingshan’s exposure to nickel was fully visible to the LME, the person familiar with the trades said. The rest of the trade was carried out in private deals known as over-the-counter agreements with the banks, according to people familiar with the trades.

Critics of the LME say it should have seen the blowup coming anyway. Tsingshan began to build a big short position last year, and the contours of the trade, if not its size, were known in the market. Public data on positions showed heavy concentrations of positions by single players in both the forward market and the physical nickel market that undergirds the trades.

The LME has been asleep at the wheel,” said Andrew Mitchell, director of nickel research at Wood Mackenzie, a consulting firm. “It got to a point where there were things going on which were not normal market forces.”

Traders on the floor of the London Metal Exchange in London.

Photo: Simon Dawson/REUTERS

Other factors exacerbated the crisis. The London market lacked guard rails in place on many other exchanges such as circuit breakers or limits to daily moves in prices.

CME Group’s Comex exchange, on which copper and gold trade, halts trading if prices move 10% within an hour.

The exchange was also slow to act and let trading continue on March 7 despite a 66% rise in nickel prices, a sign that the market had turned disorderly.

The LME dates back to sawdust circles around which merchants bought and sold metals in the early 1800s as the industrial revolution gathered steam. An open-outcry ring, formed by a tight circle of red couches, remains a fixture of the exchange where dealers exchange metals using cries and gestures.

As demand for metals swelled with the size of the Chinese economy this century, the exchange took on a new prominence and a bidding war emerged to own it. Hong Kong Exchanges and Clearing Ltd. beat CME, Intercontinental Exchange Inc. and a division of New York Stock Exchange to buy the LME in 2012 for £1.4 billion, equivalent to $2.2 billion at the time. It paid a huge premium to the value of LME’s shares.

Mr. Chamberlain advised Hong Kong Exchanges on the deal as a UBS Group AG banker before moving in-house at the LME. He reined in the LME’s freewheeling culture with a ban on drinking on the job in the open-outcry ring. He tried to stamp out trips to strip clubs during the annual LME conference.

One area he didn’t change was to force brokers to agree on clearer reporting on over-the-counter transactions. Brokerages that are members of the exchange pushed back against a proposal for more disclosure, according to LME filings. They complained about the complexity and cost of such reports.

Matthew Chamberlain, chief executive of the London Metal Exchange.

Photo: Anthony Kwan/Bloomberg News

Tsingshan meanwhile was building up a huge trade in nickel, which stood to benefit if prices fell. With smelters in China and Indonesia, Tsingshan had the capacity to flood the market with supply. 

In total, the firm sold about 190,000 metric tons of nickel on the exchange and through private deals with banks and brokers, traders and analysts estimate. At March 7 closing prices, that was worth $9.1 billion. Most of those positions were done bilaterally with different banks, not with LME forward contracts.

Traders are split over whether Tsingshan was simply hedging the vast amount of nickel it produces, or whether it was making what amounted to a massive and risky bet on the direction of prices.

Spokespeople for Tsingshan couldn’t be reached for comment.

Mr. Chamberlain said the LME will move to impose stricter requirements in the wake of the nickel fiasco. “I think now the LME will need to step in and say that these things have to happen,” he said.

The exchange has already beefed up its information-sharing requirements in nickel as well as imposing limits on daily moves for the first time. A provisional deal the banks reached with Tsingshan this week gave the exchange the confidence it could reopen the market.

Nickel traded Wednesday, Thursday and Friday, falling by the maximum amount allowed under new limits, removing some of the pressure on Tsingshan’s trades. 

The saga could open the door to rivals CME and Shanghai Futures Exchange. CME is conducting a review of what led to the blowup in London’s market with a view to potentially creating a nickel contract, a person familiar with the matter said, adding that any launch is a long way off. CME declined to comment.

“We are very conscious that the events of last week have harmed our reputation,” said Mr. Chamberlain, who is set to leave the LME this year to join a cryptocurrency company. “We accept that we have a lot of work to do to ensure that we remain that venue of choice.”

—Jing Yang and Rebecca Feng contributed to this article

Write to Joe Wallace at joe.wallace@wsj.com