Ericsson’s CEO Hans Vestberg is leaving the company, immediately, after serving in the role for seven years. Ericsson’s stock has risen 5 percent this morning on the news.

Vestberg steps down as president, CEO, and member of the board of directors. He will be temporarily replaced by chief financial officer Jan Frykhammar until a permanent CEO is found.

Vestberg’s ousting comes in a year when Ericsson has laid off thousands of its employees due to declining demand for its telecom equipment products. And just last week, the company said it’s planning to continue drastically cutting costs.

In its second quarter earnings call last week, Ericsson reported a 24 percent drop, year-over-year, in its second-quarter net profits.

Vestberg, who was with Ericsson for 28 years, appears to have been caught between the decline in 4G telecom equipment sales and the ramp-up to 5G equipment.

Ericsson has made a show of leading the charge on 5G. And that could prove lucrative in the future. But 5G is in its infancy. Ericsson’s current revenues depend on the demand for its existing mobile broadband products.

In last week’s earnings, the company reported that second-quarter sales fell 11 percent as wireless operators have cut their investments in 4G equipment.

In the company’s statement announcing his departure he said, “As the industry enters a next phase, driven by 5G, IoT and cloud, it is time for a new CEO to step in and continue the work to ensure Ericsson's industry leadership."