Wall Street bankers celebrated last year as mergers and acquisitions reached the highest level ever, topping even pre-crash 2007. This year, M&A is hitting a more dubious record: Deals gone bust.

Of the $5 trillion in transactions that were announced in 2015, nearly 10 percent — $504 billion — have since been terminated. Last Wednesday was especially bad for bankers as two mergers valued at a combined $21 billion collapsed.

The latest canceled deals mean 2015 has been stripped of its title as the biggest year for deal making, dropping to $4.06 trillion compared with 2007's $4.09 trillion.

The companies and their bankers can blame themselves for some of the failures, said Ira Gorsky, an analyst with Jersey City, N.J.-based Elevation. Deals have grown so large, and in already consolidated industries, as to provoke the wrath of aggressive antitrust enforcers.

That was the case with the end of Staples' attempt to buy Office Depot for $6.3 billion. The FTC had argued that uniting the office suppliers would harm buyers, and a federal judge agreed last Tuesday. The companies said they would terminate their agreement.

Hours later, the European Union blocked CK Hutchison Holdings' $14.8 billion bid to buy Telefonica's O2 unit. Regulators cited the merger's potential to hinder competition and drive up prices.

Size isn't the only factor drawing scrutiny. Antitrust enforcers at the Justice Department in April frustrated Canadian Pacific Railway Ltd.'s bid to buy Norfolk Southern Corp., opposing a voting trust structure that called for Canadian Pacific's chief executive to run Norfolk Southern.

The challenge came days after the government sued to stop Halliburton's takeover of Baker Hughes Inc., which had been languishing for about a year and a half. The companies failed to overcome concerns that the deal would reduce choice in oil field services, running a risk of higher oil and gas prices for consumers.

The Treasury, too, has been aggressive in its efforts to scuttle deals it sees as opposing the national interest. Officials torpedoed the $160 billion merger of Pfizer Inc. and Allergan PLC by proposing the tightening of regulations to crack down on corporate tax inversions — deals that allow a U.S. company to shift its tax address offshore.

Still, some dealmakers are optimistic. "The transaction pipeline remains robust … " said Eric Shube, a New York-based corporate partner at law firm Allen & Overy.