SANTA CLARA, California — Intel said Wednesday that greater demand from data centers and sales of memory products helped counteract the slumping PC market in the second quarter.

The world's largest chipmaker said its net income and revenue both fell compared to last year and it again trimmed its estimates for the year, but the results looked good compared to Wall Street's estimates. Shares of Intel Corp. rose 69 cents, or 2.3 percent, to $30.38 in aftermarket trading.

The company said revenue from its data center and Internet of things businesses improved. Intel and some of its competitors have been hurt by weak demand for personal computers as more people buy smartphones and tablets instead. In June Intel agreed to buy chip designer Altera for $16.7 billion, trying to expand its business to include chips that will power wireless devices, smart cars, and other products.

Intel said its profit fell 3 percent to $2.71 billion, or 55 cents per share, and revenue shrank 5 percent to $13.2 billion.

Analysts expected Intel to report net income of 50 cents per share and $13.04 billion in revenue, according to Zacks Investment Research.

Intel now says its annual revenue will fall about 1 percent, implying a total of around $55.31 billion. In April the company said revenue would be about the same as in 2014, when it had $55.87 billion in sales. FactSet says analysts were already expecting a lower total of $54.67 billion.

Intel is forecasting revenue of $13.8 billion to $14.8 billion in the third quarter. Analysts surveyed by FactSet expected $14.06 billion, on average.

Shares of Santa Clara, California-based Intel have fallen 18 percent in 2015 and closed at $29.69 on Wednesday.