Tech giant Intel (INTC.O) has made a surprising turnaround, posting a quarterly profit that exceeded expectations. The slump in the PC market, driven by a surge in demand during the pandemic, had led to a glut of inventories, but the situation is now beginning to stabilize. PC shipments fell only 11.5% in the June quarter, compared to the steep 30% declines in the previous two quarters, indicating a gradual recovery.

The company’s success can largely be attributed to a rebound in desktop sales, which had hit near-record lows in the previous quarter. This resurgence in desktop purchases has bolstered Intel’s profits and led to a significant increase in the company’s market value by nearly $9 billion. However, it’s worth noting that Intel has faced stiff competition from rivals like Nvidia (NVDA.O), Advanced Micro Devices (AMD.O), and Broadcom (AVGO.O) in recent years.

Despite the positive results, Intel’s largest segment, which includes personal computers, saw revenue fall by 12% to $6.8 billion from $7.7 billion a year earlier. On the other hand, Intel’s foundry business, which manufactures chips for other companies, reported revenue of $232 million, up from $57 million a year ago. This boost can be attributed to Intel’s innovative approach of using “advanced layout” to combine parts of chips made by other companies to create more powerful chips, catering to the growing demand for high-performance computing and artificial intelligence applications.

Intel is making strategic moves to strengthen its position in the AI computing space. It recently announced a collaboration with Ericsson (ERICb.ST) to produce chips using advanced manufacturing technology. While the company’s data center and artificial intelligence sales declined 15% to $4 billion from the year-ago quarter, Intel remains optimistic about the AI market. The firm already has substantial orders for AI chips, projecting at least $1 billion in sales through 2024.

Despite the encouraging performance, Intel still faces challenges in the server chip market, losing market share in server CPUs and grappling with relevance in the AI domain. Cloud majors like Microsoft (MSFT.O) and Alphabet are directing their spending on data centers towards Nvidia (NVDA.O) for AI chips, impacting Intel’s server chip market share.

Nevertheless, Intel’s forecast for the current quarter shows promise, with adjusted earnings per share projected at 20 cents, and adjusted revenue expected to be between $12.9 billion and $13.9 billion. The company anticipates an adjusted gross margin of 43% for the third quarter, signifying a positive outlook for the coming months.

Intel’s share price has risen about 30% this year, fueled by industry recovery expectations, although it trails the 50% surge in the Philadelphia SE Semiconductor (.SOX) index. As Intel navigates the ever-changing tech landscape, it will continue to face both challenges and opportunities, aiming to maintain its position as a major player in the semiconductor industry.