Sundar Pichai, chief executive officer at Google LLC, speaks during the Google Cloud Next ’19 event in San Francisco, California, U.S., on Tuesday, April 9, 2019.

Michael Short | Bloomberg | Getty Images

Shares of Alphabet rose nearly 6% Wednesday, driven by stronger-than-expected second-quarter earnings and marked year-over-year growth in cloud computing revenue.

The company on Tuesday reported adjusted earnings per share of $1.44, more than the $1.34 expected by a Refinitiv survey of analysts. Revenue for the second quarter came in at $74.6 billion, beating a consensus estimate of $72.82 billion.

related investing news

But it was strong growth in cloud computing that helped drive the stock surge, with the company reporting $8.03 billion in Google Cloud sales, compared to a StreetAccount consensus of $7.87 billion. Google Cloud competes with Amazon Web Services and Microsoft Azure.

Google’s cloud unit reported its second consecutive quarter of operating profit, with second-period income of $395 million, compared to a $590 million loss in the year-ago quarter.

Wall Street analysts cheered the results.

“While questions will remain about AI’s impact on core products (e.g. if such a shift can be disruptive over the short-term) or costs structure (e.g. if computing costs per search will rise), we see Alphabet as the leader in compounded AI investment in the past 5-6 years and well positioned to capitalize on this trend in the coming decade,” Goldman Sachs analyst Eric Sheridan said.

The company also announced Wednesday that finance chief Ruth Porat would assume a newly created president and chief investment officer position. Porat will remain in the role until a successor is identified, Google said in a press release.

— CNBC’s Jennifer Elias contributed to this report.