What happened

Shares of Telefonaktiebolaget LM Ericsson (ERIC -0.76%) surged on Friday following the telecommunications company's first-quarter report. While revenue tumbled compared to the prior-year period, the company managed to turn a small profit on an adjusted basis. That was enough to drive the stock 17.1% higher by market close.

So what

Ericsson reported first-quarter net sales of 43.4 billion Swedish krona (SEK), down 9% year over year. At the current exchange rate, that translates to about $5.1 billion U.S. Adjusted for currency, sales fell by just 2%. Revenue declined in Northeast Asia, Southeast Asia, Oceania, and India, with growth in other market areas.

An Ericsson suburban mast.

Image source: Ericsson.

Networks revenue slumped 10%, to SEK 28.6 billion, while digital services revenue dropped 9%, to SEK 7.7 billion. Managed services revenue fell 8%, to SEK 5.5 billion, and emerging business and other revenue declined 7%, to SEK 1.6 billion.

Ericsson lost SEK 0.25 per share on an international financial reporting standards (IFRS) basis but managed a non-IFRS net profit of SEK 0.11 per share. That compares to a non-IFRS net loss of SEK 2.19 per share in the prior-year period. Excluding restructuring charges, gross margin came in at 35.9%, while operating margin was 2%.

Now what

While Ericsson's results weren't great on an absolute basis, they were a vast improvement compared to the first quarter of 2017. Looking ahead, the company expects to boost its gross margin to a range of 37% to 39% by 2020. The radio access network-equipment market is expected to decline by 2% this year but grow by 2% annually through 2022. Weak demand in China will be offset by strength in North America.

With shares of Ericsson down 47% over the past three years prior to this post-earnings rally, investors got some relief with a stronger-than-expected quarterly report.