Alphabet’s capital expenditures in the latest quarter almost doubled, as Google continues to build out data centers for products like its cloud services.

In the second quarter, those costs jumped to $5.48 billion from $2.48 billion a year earlier, Alphabet said in its earnings report after the close of trading on Monday. Analysts on average were expecting capital expenditures of $4.19 billion, according to FactSet.

The spending surge is the latest sign that Google’s cloud division, under the leadership of Diane Greene, remains committed to growth as it tries to chase down larger rivals Amazon and Microsoft. Google is also expanding its data centers for internal use, whether it’s search or YouTube.

“Our view is it gives you a lens into our outlook for growth,” said Ruth Porat, Alphabet’s chief financial officer, in a briefing with reporters on Monday. “It’s search and ads, it’s newer businesses, it’s also the importance of machine learning. We’re looking for additional compute capacity given our outlook for growth.”

On the call with analysts on Monday, Porat elaborated on those remarks and specifically cited cloud as a new growing business with major computing needs.

“While we’re ensuring that we’re well-positioned to support the growth we see, we do constantly remain focused on efficiency per unit of compute,” she said.

Costs in the first quarter were even higher, coming in at $7.3 billion, because of a $2.4 billion charge for buying Chelsea Market in New York. Excluding the quarter, the second quarter marked the biggest percentage increase in capital expenditures since 2014.

Earlier this year, Google gave the public its first clear sense of the size of the cloud business. CEO Sundar Pichai, told analysts in February that between the G Suite productivity apps and the Google public cloud for hosting apps, the company was generating $1 billion in revenue per quarter.

Alphabet provides a limited view about growth. In the first and second quarter there were no major cloud updates — only that cloud was a category that contributed to revenue expansion for Alphabet as a whole. For example, on Monday’s call Pichai mentioned Target as a “key win” for Google’s cloud in the quarter.

Google’s determination to grow in the cloud is reflected in ways other than infrastructure spending. Across Alphabet, cloud has been one of the biggest areas for hiring in the past two years. Porat said on Monday that sales and marketing costs were up in part because of sales and marketing headcount growth for cloud, followed by advertising investments for cloud and the Google Assistant.

— CNBC’s Josh Lipton contributed to this report.