By Matt Egan, CNN Business

Corporate America's cash-hoarding ways may finally be ending.

US nonfinancial companies were sitting on $1.69 trillion at the end of 2018, according to a Moody's Investors Service report released on Monday. While that's an epic amount of money, it's down by 15% from the record $1.99 trillion at the end of 2017.

The decline — the first since Moody's began tracking the figures in 2007 — reflects a major shift driven by the 2017 tax overhaul, strong economic growth and mega share buybacks.

"With improved access to global cash following the tax overhaul, we expect aggregate cash balances will continue on a declining path," Richard Lane, a Moody's senior vice president, wrote in the report.

The top five cash-rich companies — Apple, Microsoft, Alphabet, Amazon and Facebook — drew down their war chests by a combined $111 billion, according to the report.

Apple alone held $245 billion in cash at the end of 2018, down nearly 17% from the year before. Still, Apple's cash pile is bigger than the aggregate amount of cash of every non-tech industry, according to Moody's.

Buybacks spike 99%

So where is that cash going?

Corporate America stepped up its spending across-the-board, deploying record amounts of cash on acquisitions, which Moody's said increased nearly 15% to $405 billion. Dividend spending rose modestly as well.

In a positive sign for the economy, business investment on job-creating items like factories and software jumped 12% to a record $851 billion, according to Moody's.

But, as many predicted would happen following the passage of the tax law, Corporate America set aside its biggest spending increases for shareholder rewards. Net share buybacks (share repurchases minus stock issuance) spiked 99% to a record $467 billion, Moody's said.

Tech companies alone splurged on $260 billion of buybacks. Apple repurchased $71 billion of shares in 2018, more than doubling Oracle, the next closest company.

Moody's noted that buybacks accelerated after tax reform. The law gave companies a tax incentive to repatriate overseas cash, some of which had been sitting in foreign bank accounts for years. Buybacks are expected to decrease in 2019.

Trade war casts shadow over business spending

Business investment, the stated reason behind the tax law, is expected to decelerate in 2019 to mid-single-digit growth, according to Moody's. That trend is being driven in part by the trade war between the United States and China — a destabilizing atmosphere that makes it difficult for companies to plan.

"Economic activity has decelerated from rapid growth in the first half of 2018," Moody's said in the report. "Elevated trade tensions have exacerbated the cautionary stance on business investment that will weaken business conditions in 2019."

The trade war and warning signals in the bond market have raised concerns about an economic slowdown or even a recession in the United States.

Such a downturn could create trouble for companies that took on too much debt. Those overleveraged firms may be forced to rapidly slash spending and cut jobs, deepening the recession.

And yet Corporate America didn't meaningfully pay down its collective debt last year.

Total debt at US nonfinancial companies stood at $5.65 trillion at the end of 2018, according to Moody's. That was up by just $80 billion from the year before, the slowest pace since 2009.

If a recession emerges in the next year or two, companies may wish they put more of a dent in that huge pile of debt.