Home Depot named its chief financial officer, Richard McPhail, as its next CEO, succeeding Ted Decker, the company said Tuesday. The change takes effect next week.

Decker, CEO since 2022, had been on temporary medical leave since August. The company said he has returned from leave but is stepping down from the top job. He will remain chair of the board.

"I'm glad to be back and grateful for the support I received," Decker told analysts. "The board and I have agreed that now is the right time to move to the next phase of our succession plan."

Ann-Marie Campbell, currently senior executive vice president of U.S. stores and operations, will become president and chief operating officer. Jordan Broggi was chosen to succeed McPhail as CFO. McPhail has been with the company since 2005.

McPhail told CNBC's Becky Quick, "We're not going to change course." He said the company will keep focusing on professional shoppers, such as contractors, and on artificial intelligence tools to drive sales. He added that Home Depot faces more challenges now than at the start of the year but is still gaining share of the home improvement market.

The announcement came alongside third-quarter results. Home Depot reported net income of $3.71 billion, or $3.72 per share, compared with $3.60 billion, or $3.62 per share, a year earlier. Excluding one-time items, adjusted earnings per share were $3.86. Revenue rose 4.9% from the year-ago period. Comparable sales rose 2.2%, versus analyst estimates of 1.8%, according to StreetAccount. Online comparable sales grew about 13%.

For the full year, Home Depot expects total sales to rise roughly 4.5%, the top of its previous range. It now expects comparable sales to grow about 1.4%, up from a previous outlook of flat to 2%. It also expects adjusted earnings per share to rise 2%, compared with prior guidance of flat to 4%.

Shares of Home Depot fell more than 3% following the announcement and results.