IBM said Thursday that Ginni Rometty will step down as chief executive in April, capping an eight-year run at the helm during which the technology giant struggled with growth. She will be succeeded by Arvind Krishna, currently the company’s senior vice president for cloud and cognitive software.

Rometty, who has been with the company for 40 years, will continue as executive chairman through the end of the year, when she will retire. In a statement, IBM said Krishna was the company’s chief architect of its acquisition of open-source-software company Red Hat, the largest acquisition in IBM’s history. It also said James Whitehurst, senior vice president and chief executive of Red Hat, would become IBM’s president. Krishna was also elected to IBM’s board of directors.

“Arvind is the right CEO for the next era at IBM,” Rometty said in a statement. “He is a brilliant technologist who has played a significant role in developing our key technologies such as artificial intelligence, cloud, quantum computing and blockchain.”

IBM called the transition the “outcome of a thorough succession planning process,” ticking through Rometty’s milestones as chief executive, such as acquiring 65 companies, building a $21 billion hybrid cloud business and transitioning the company’s portfolio toward higher-value businesses, divesting nearly $9 billion in annual revenue.

Rometty’s departure marks another exit from the ranks of female CEOs at the largest publicly traded companies. As of Jan. 15, the research and advocacy group Catalyst counted only 29 women, including Rometty, heading S&P 500 companies. That is less than 6 percent of CEO positions at those companies.

IBM shares rose nearly 5 percent in after-hours trading following the announcement.

The company’s most recent quarterly earnings report on Jan. 21 reported a slight increase in quarterly revenue, snapping a streak of falling sales, and beat analysts’ earnings expectations. It also issued a 2020 outlook that was above analysts’ forecasts, and headlines suggested IBM was showing signs of a turnaround.

Rometty was often described as inheriting a company in transition, one trailing rivals such as Microsoft and Amazon in the area of cloud computing. Craig Lowery, a vice president with Gartner Research, said that like many companies with a “heritage of traditional IT,” IBM was facing disruption when Rometty took the helm.

“Her tenure was largely marked by the need to overcome that — to figure out how to set IBM’s strategy to remain relevant in the changing market,” Lowery said.

Calling the Red Hat acquisition Rometty’s “crowning achievement,” Lowery said naming Krishna and Whitehurst to leadership positions “sends a signal that the board is serious” about IBM’s take on its cloud strategy. “It’s significant those are the two people they chose.”