Nvidia Corp. shares rallied in the extended session Thursday after the chip maker’s data-center sales and outlook topped Wall Street estimates while returning to revenue growth.

Nvidia NVDA, -0.65%  shares rose more than 6% after hours, following a 0.7% decline in the regular session to close at $270.78.

The company reported fourth-quarter net income of $950 million, or $1.53 a share, compared with $567 million, or 92 cents a share, in the year-ago period. Adjusted earnings were $1.89 a share.

Revenue rose to $3.11 billion for its first quarterly gain in four quarters, compared with $2.21 billion in the year-ago quarter.

Analysts surveyed by FactSet had forecast earnings of $1.67 on revenue of $2.96 billion.

Read: For chip companies, stocks soared as sales slumped in 2019 — what does that mean for 2020?

Nvidia reported gaming sales of $1.49 billion, while analysts had forecast $1.52 billion, and data-center sales of $968 million, compared with the Wall Street consensus of $825.8 million.

The company expects revenue of $2.94 billion to $3.06 billion for the first quarter, while analysts had forecast revenue of $2.85 billion.

Read: Nvidia earnings: A return to revenue growth expected after a tough year

Over the past 12 months, Nvidia shares have gained 77%. In comparison, the S&P 500 index SPX, -0.16% has gained 23%, the tech-heavy Nasdaq Composite Index COMP, -0.14% has grown 31%, and the PHLX Semiconductor Index SOX, +0.08% has increased 46% in that time.

Of the 39 analysts who cover Nvidia, 28 have buy or overweight ratings, nine have hold ratings and two have sell or underweight ratings, with an average price target of $262.41.