Companies repurchased $178 billion of shares during the first quarter, up more than 42 percent from the same period in 2017, according to S.&P. Dow Jones Indices. That was the largest amount ever repurchased, topping the previous record from the third quarter of 2007.

Companies buy back their shares when they believe they have nothing better to do with their money than to return capital to shareholders. By reducing the number of shares outstanding, the buybacks can help boost the companies’ stock prices.