Michael Dell

David A. Grogan | CNBC

Dell shares surged 21.3% Friday, their best day since the company returned to the public market in 2018. The rally followed a better-than-expected earnings report, driven by a big revenue beat.

The maker of IT hardware and infrastructure technology said sales slid 13% from a year earlier to $22.9 billion, topping the $20.9 billion average analyst estimate according to Refinitiv. Adjusted earnings per share of $1.74 exceeded the $1.14 average analyst estimate.

Dell traded at $68.59 as of midday Friday. It’s on pace for its biggest gain and highest close since the company relisted its stock five years ago. Dell was taken private in 2013 by founder Michael Dell and a group of private equity firms.

In addition to its rosy earnings report for the latest quarter, Dell increased its forecast for the year. The company now expects full-year sales of between $89.5 billion and $91.5 billion, representing a 12% year-over-year drop at the middle of the range. Dell previously was calling for a drop of about 15%.

Despite a decline in revenue, Morgan Stanley on Friday named Dell its top IT hardware pick, replacing Apple. The firm wrote in a report that Dell “is emerging as an early Generative AI winner,” referring to the latest developments in artificial intelligence.

Morgan Stanley sees Dell benefiting from booming demand for artificial intelligence servers as more companies focus their spending on that corner of the hardware market. The analysts recommend buying the stock and lifted the price target to $70.

“DELL is the first company in our coverage to directly benefit from the Gen AI spending cycle,” the analysts wrote, pointing to Dell’s disclosure of a $2 billion backlog of AI servers.

Morgan Stanley maintained an overweight rating for Apple but noted risks of increased regulation around the app store.

Prior to Friday, Dell’s biggest one-day gain since 2018 was a 14% increase in March 2020, according to FactSet. Its previous record close was $60.77 in February of this year.

Correction: A headline for this story has been updated to reflect that Dell returned to the public market in 2018. A previous headline misstated the year.

Subscribe to CNBC on YouTube.

WATCH: AI wave will begin to split between open and closed-source models, says Dell Technologies CEO