NEW YORK — Intel on Thursday raised its revenue guidance, saying sales of computers for businesses have been stronger than expected.

The higher forecast provides another hint of optimism in the PC industry, where Intel gets the majority of its revenue, after two straight years of declining global shipments. The chipmaker is getting a lift as businesses replace aging machines following the end of Microsoft’s support for its Windows XP software — a cycle that will continue into next year, said Suji De Silva, an analyst at Topeka Capital Markets.

“There’s definitely an XP refresh factor here, and it’s going to be multiquarter,” said De Silva, who recommends buying Intel stock. He predicts that PC unit shipments will fall about 5 percent this year and may rise in 2015. New slimmer laptops, based on Intel’s latest products, may also convince consumers to increase spending on computers, he said.

The world’s largest chipmaker is now forecasting revenue of $13.4 billion to $14 billion in the second quarter. The Santa Clara, Calif., company had expected $12.5 billion to $13.5 billion in revenue in the quarter. Intel also expects stronger profit margins.

It also said it expects revenue to grow in 2014. In January, Intel said its sales would be about the same as last year’s total of $52.71 billion.

Analysts were forecasting $13.02 billion in revenue for Intel during the second quarter, according to FactSet. Their projections called for $53.07 billion in annual revenue.

Intel’s shares rose $1.34, or 4.8 percent, to $29.30 in aftermarket trading. That put the stock on pace for a possible two-year high on Friday.

Intel’s processors are inside about 80 percent of the world’s PCs, and its results are often a bellwether for other chip companies. But its historically strong business of selling chips for personal computers has languished as people buy smartphones and tablets instead of PCs.

Intel is scheduled to report its second-quarter results on July 15. Analysts expect it to report a profit of 46 cents per share.

Shares of Intel rose 3 cents to $27.96 on Thursday before the release of the sales forecast. The stock reached an annual high of $28.42 on Monday but has not traded at $29 since May 2012.