Advanced Micro Devices Inc posted better-than-expected second-quarter results as corporate spending on tech hardware strengthened, sending its shares up 6.6 percent after hours.

AMD, which competes with much-larger rival Intel Corp , said on Thursday that revenue rose 40 percent to $1.65 billion in the period, beating expectations of $1.55 billion according to Thomson Reuters I/B/E/S.

It posted net income, excluding items, of $83 million, or 11 cents a share, versus a net loss of $244 million, or 37 cents a share, in the year-ago period. That surpassed expectations for 6 cents a share.

AMD's earnings report came two days after competitor Intel set a bright tone for earnings, signaling a resurgence of IT enterprise spending after years of straitened budgets.

Looking forward, the company estimated revenue in the third quarter would be up seasonally. Analysts had been expecting revenue of $1.66 billion in the third quarter.

Shares of Sunnyvale, California-based AMD rose 6.6 percent to $7.90 in after-hours trading, after closing nearly flat at $7.41 on the New York Stock Exchange.

(Reporting by Alex Dobuzinskis: Editing by Richard Chang)