Image source: Office Depot.

What: Shares of both Staples (SPLS) and Office Depot (ODP 1.82%) tumbled on Wednesday after the office supply companies were blocked from merging. At 10:45 a.m. ET, Staples stock was down about 17%, while shares of Office Depot had fallen 39%.

So what: After a 15-month saga, a federal judge on Tuesday sided with the Federal Trade Commission and blocked the merger between Staples and Office Depot. The judge concluded that there was a reasonable probability that the merger between the two leading office supply companies would impair competition and lead to higher prices for large organizations.

Soon after the news broke, Staples announced that it was terminating the merger agreement. Staples will pay Office Depot a $250 million breakup fee and embark on a new plan to turnaround its business. Staples plans to cut $300 million of costs by the end of 2018, continue closing unproductive stores in North America, increase its focus on mid-market businesses with 10-200 employees, and explore strategic alternatives for its European operations. Office Depot will hold an investor conference call on May 16 to discuss its go-forward strategy.

Now what: Staples and Office Depot face plenty of competition in retail, but the commercial business is far less competitive. The looming threat of Amazon, currently a small player in the business-to-business market, wasn't enough to sway the judge to side with Staples and Office Depot.

Going forward, Staples is in a far better financial position than Office Depot. The company remains profitable, expected to generate around $600 million of free cash flow this year, and the balance sheet is in good shape, with just $1 billion of debt and $825 million of cash at the end of the fourth quarter.

Office Depot is far less profitable, with the company posting a $37 million free cash flow loss during 2015. Office Depot also has more debt than Staples, about $1.3 billion, despite its smaller size. With the merger dead, Office Depot is in a difficult situation.