A few years ago, FedEx (FDX 0.16%) was struggling with an unwieldy cost structure in its signature express delivery business. The company had simply deployed too much capacity in anticipation of a surge in demand that never quite materialized.

Yet even as the underlying business struggled with cost containment, FedEx maintained a rock-solid balance sheet. At the end of the company's 2013 fiscal year, FedEx had $4.9 billion of cash and investments, compared to just $3.0 billion of debt.

Today, the situation is reversed. FedEx has successfully turned the express business around in the past three years, leading to a surge in profit from that segment. However, now its balance sheet looks more suspect, due to two significant acquisitions, heavy growth investments, and liberal spending on dividends and share buybacks.

Investment spending surges

In the past three years, FedEx has quickly ramped up its capital spending to support two key investment priorities. First, it has been replacing older aircraft in its fleet with modern, easy-to-maintain, and fuel-efficient models. Second, it is steadily expanding the package-handling capacity of its FedEx Ground network to cope with e-commerce growth.

FedEx has replaced lots of older airplanes like this one in recent years. Image source: The Motley Fool.

Due to these initiatives, total capex rose from $3.4 billion in fiscal 2013 to $4.8 billion in the recently completed 2016 fiscal year. Most of the growth came from the ground business, where capex nearly tripled from $555 million to $1.6 billion during that span.

Acquisitions have also been a big use of cash for FedEx, totaling more than $6 billion over the past two years. Most of that relates to buying TNT Express: a deal that closed in late May.

FedEx rewards shareholders with big buybacks, too

Looking at the past three years together, FedEx generated about $15.3 billion of operating cash flow. It then spent $12.7 billion on capex and $6.1 billion on acquisitions (after deducting cash it acquired). FedEx had to cover the difference by issuing debt.

Despite these big investments in organic growth and acquisitions, FedEx has also aggressively returned cash to shareholders. During the same three-year period, it spent a stunning $9.5 billion on share repurchases and dividends.

Obviously, this spending had to be funded by debt, too. Whereas FedEx had more cash than debt three years ago, by the end of February it had $8.5 billion of debt and less than $3 billion of cash and investments. Moreover, that was before FedEx issued more than $5 billion of debt to fund its TNT acquisition last quarter.

As a result of this massive increase in FedEx's financial leverage, top credit rating agency Moody's reduced the company's credit rating in March.

Leverage may rise further

Investors shouldn't expect any quick improvement in FedEx's financial position. Last month, management revealed that capital spending will continue to rise in the coming year. For fiscal 2017, FedEx expects to spend $5.1 billion on capex -- and that doesn't even include investments related to its recent acquisition of package delivery rival TNT Express.

FedEx's capital spending will rise again in fiscal 2017. Image source: The Motley Fool.

Meanwhile, FedEx expects to incur $200 million of integration costs and $100 million of integration capex related to TNT Express. To make matters worse, the underlying TNT Express business generated negative free cash flow last year.

Thus, while FedEx's underlying performance may improve again due to its ongoing efficiency initiatives, the company will likely produce little or no free cash flow this year. That didn't stop it from boosting its dividend by 60% recently. FedEx may also continue repurchasing shares in the coming year -- it ended fiscal 2016 with an outstanding authorization to buy back 19 million shares (nearly $3 billion based on FedEx's recent stock price).

Risk is growing

FedEx has shown in the past several years that it can generate steady growth in operating cash flow to fund its investments and capital returns. If anything, the TNT Express acquisition should add to its cash generation potential, once FedEx wrings out merger synergies.

In other words, FedEx will most likely produce ample free cash flow going forward, which it would be able to use for debt repayments. That said, the vast increase in its debt load makes it more vulnerable to a business downturn.

This is not just a hypothetical risk. Beyond the ever-present threat of the economy falling into recession, FedEx has dramatically increased its exposure to Europe (via TNT Express) just in time for the "Brexit" drama, which could potentially have a chilling effect on European trade.

Furthermore, American politicians on both sides of the aisle seem increasingly hostile to trade. Any increase in trade barriers at home could harm FedEx's express business. Given these global risks facing FedEx, it's unfortunate that the company has added an extra layer of risk by dramatically increasing its debt burden in the last three years.