Microsoft is putting some of its piles of cash to work, authorizing a plan to re-purchase up to $40 billion in shares in one of the biggest stock buybacks in the company’s history.

This isn’t the first time Microsoft has earmarked major cash to buy stock back from investors and on the open market. Microsoft has twice authorized $40 billion for stock buybacks, first in 2013 and then again 2016.

With this move, Microsoft will take millions of shares off the market at a time when its stock price is rising rapidly, potentially pushing it even higher.

Companies buy back stocks for a number of reasons. Stock buybacks tend to boost earnings per share by reducing the number of available shares. The company could want to consolidate ownership and voting power. It could be to return cash to investors. Or, Microsoft might feel its surging stock remains undervalued.

Shares in the tech giant have climbed 35 percent so far this year, pushing its market capitalization above $1 trillion. At a price of $141.75 Thursday morning, up 2.3 percent, Microsoft stock is trading just under its all-time high of $142.37 in late July.

Microsoft had about $11.4 billion left to spend out of its last $40 billion buyback plan as of the end of June, per the company’s annual 10-K filing with the U.S. Securities and Exchange Commission. From 2017 through 2019, Microsoft spent $35.7 billion to repurchase approximately 419 million shares.

In addition to the stock buyback, investors will get a 11 percent bump on their quarterly dividend to $0.51 per share, Microsoft said.

As companies have executed more stock buybacks in recent years, the practice has come under fire. Buybacks reached an all-time high in 2018 with more than $1.1 trillion worth of share re-purchasing announced.

Critics say companies are prioritizing enriching shareholders over increasing wages for workers or investing in the business.

“In the past, this money flowed through the broader economy in the form of higher wages or increased investments in plants and equipment. But today, these buybacks drain trillions of dollars of windfall profits out of the real economy and into a paper-asset bubble, inflating share prices while producing nothing of tangible value,” Nick Hanauer, the Seattle venture capitalist who has developed a reputation for calling out economic policies that favor the rich, wrote in a 2015 essay for The Atlantic.

Buybacks have gotten the attention of presidential candidate and U.S. Sen. Bernie Sanders, who last year introduced a bill that would bar companies that pay employees less than $15 an hour from buying back stock.

As whispers of an incoming recession are getting louder, one economist pointed the finger at corporate stock buybacks earlier this year as a potential cause of a downturn, rather than a housing crisis or issues with banks.

“It’s really about these bloated corporate balance sheets,” Gluskin Sheff Chief Economist and Strategist David Rosenberg told CNBC in May. “There will be a price to pay for the unprecedented debt-for-equity swap we did this cycle, borrowing at low interest rates and buying back your stock. That is certainly something that is not sustainable.”