By Ben Eisen and Chris Dieterich

Updated Nov. 23, 2017 2:47 p.m. ET

Large companies are repurchasing their shares at the slowest pace in five years, as record U.S. stock indexes and an expanding economy propel more money out of flush corporate coffers into capital spending and mergers.

Companies in the S&P 500 are on pace to spend $500 billion this year on share buybacks, or about $125 billion a quarter, according to data from INTL FCStone. That is the least since 2012 and down from a quarterly average of $142 billion between 2014 and 2016.

Ebbing Trend

The pace of buybacks among S&P 500 companies is expected to have slowed this year

Buybacks have been popular in recent years, in part because tepid economic growth limited perceived investment opportunities as well as expected returns on new plant and expanded operations. Adding to their appeal, repurchases can make shares more attractive to investors by lowering the share count and accordingly increasing earnings per share. The postcrisis surge in buybacks has been frequently cited by stock-market bears as a sign that the market’s eight-year-long advance has been driven more by financial engineering than by long-term growth.

But this year, companies have pulled back from buybacks, reflecting in part an uptick in the global economy, rising consumer and investor sentiment and expectations that a rally that has taken the Dow industrials up 19% this year cannot continue indefinitely.

“Persistently high business sentiment since the election of [U.S. President Donald] Trump has convinced corporate chieftains that cash can be put to better use than retiring stocks,” said Vincent Deluard, INTL FCStone’s head of global macro strategy.

Capital expenditures by U.S. companies have been muted for most of the postcrisis recovery. But a Federal Reserve Bank of Philadelphia index that forecasts such spending for manufacturing companies over the next six months climbed to its highest level in more than 30 years over the summer.

Opening the Wallet

A measure of expected CapEx over the next six months was recently at a three-decade high

Buyback activity among top-rated nonfinancial debt issuers, many of which have regularly borrowed money to finance share repurchases, declined for the third straight quarter in the July-to-September period, according to Bank of America Merrill Lynch. Meanwhile, mergers and acquisitions among that group of companies had their biggest quarter of the year, analysts at the bank said.

A slowing pace of buybacks hasn’t hindered stock prices much, with major indexes climbing to scores of fresh records this year.

Corporations are still major buyers of their own shares and are expected to remain so next year. Analysts at Goldman Sachs forecast a 3% uptick in buybacks to $510 billion in 2018.

Where to Spend?

Shareholder returns as a portion of sales this economic cycle have been high, while capital expenditures have been low.

One wild card for future buybacks is the tax-overhaul legislation being negotiated on Capitol Hill. Multinational companies have parked over $1 trillion in profit earned overseas to avoid paying the 35% U.S. corporate tax rate. The House tax bill approved this month would impose a reduced one-time tax rate on such offshore cash, an incentive to bring money back home.

It is not clear to what degree companies would use repatriated cash to fund capital expenditures and acquisitions, buy back shares or raise dividends. The decline in buybacks this year, and an uptick in spending on investment and dividends, is prompting some analysts to predict that a tax-law change in this cycle could play out differently than it did in 2004, when much of the money that companies brought back from overseas was funneled directly into share repurchases.

Factors including high stock price, historically high share valuations and uncertainty over the future shape of the tax code mean that “companies may be less likely to favor buybacks over other uses of cash in 2018,” analysts at Goldman Sachs Group Inc. said in a report this week.

But other changes in the economy, markets and the regulatory environment could increase repurchase activity next year. The largest U.S. financial firms are becoming free to return more cash to shareholders. After the financial crisis, regulations required the Federal Reserve to sign off on banks’ capital plans. The improving health of financial firms should clear the way for more bank buybacks in the years ahead, analysts say.

There are some signs that investors are no longer as drawn to companies that buy back shares in large quantities. The PowerShares BuyBack Achievers Portfolio , a $1.3 billion exchange-traded fund tracking companies that have decreased their share counts over the past year, has had more than $200 million in outflows since the end of last year, according to data provider XTF.

To be sure, companies are still returning cash to investors in other ways. Dividend payments by S&P 500 companies are poised to set a sixth consecutive record in 2017, according to S&P Dow Jones Indices.

Write to Ben Eisen at ben.eisen@wsj.com and Chris Dieterich at chris.dieterich@wsj.com

Appeared in the November 24, 2017, print edition as 'Firms Cut Buybacks As Stocks Become Expensive.'