Cisco said it plans to recognize hundreds of millions of pretax charges related to the restructuring, which will end around the first quarter of the 2018 fiscal year.

The announcement came as the company reported better-than-expected earnings for the fiscal third quarter, but worse-than-feared forward guidance. Shares fell more than 5 percent after hours.

Cisco posted adjusted earnings of 60 cents per share, excluding items, on revenue of $11.94 billion. That’s higher than the 58 cents per share on $11.89 billion revenue expected by a Thomson Reuters consensus estimate.

But the future isn’t quite as bright as Wall Street hoped: Cisco said it expects revenues to fall 4 percent to 6 percent year-over-year in the fourth quarter, with earnings of 60 cents to 62 cents per share, adjusted.

Analysts expected Cisco’s revenue to decline just 1 percent in the fourth quarter, and predicted a midpoint of 62 cents per share for earnings.

Cisco has plowed money into acquisitions of companies that could help it capitalize on trends like cloud computing, analytics, and artificial intelligence. The company said last year it expects to reinvest the cost savings from its restructuring plan into “key priority areas such as security, IoT, collaboration, next generation data center and cloud.”

— CNBC’s Christine Wang contributed to this report