(Reuters) - Alphabet Inc easily beat Wall Street’s quarterly profit forecasts on Monday, helped by strong mobile advertising sales, sending the shares of Google’s parent higher in after-hours trading to surpass Apple Inc as the most valuable U.S. company.

For the first time, the company disclosed the profitability of Google’s search engine and its other online services, and how much it is spending on ambitious technology projects such as self-driving cars.

The numbers were lapped up by investors, who saw room for growth in Google’s traditional business, and were relieved to see that spending on new projects it calls ‘Other Bets’ was not as lavish as some had feared.

“It’s pretty interesting that 80 percent of YouTube views come from outside of the United States. I didn’t think it would be that high,” said Kevin Kelly, managing partner at Recon Capital. “It demonstrates that the value of YouTube can continue to be extracted,” he said.

The operating profit margin for its Google unit was 31.9 percent in the most recent quarter, compared to 25 percent for Alphabet.

Alphabet spent $869 million on capital expenditures for the Other Bets in 2015, up from $501 million in 2014. It has not made any projections about if or when those bets cumulatively would become profitable.

“As long as the core business continues to operate well with accelerated revenue... investment in those businesses can continue,” said Ronald Josey of JMP Securities.

The company said consolidated revenue jumped 17.8 percent to $21.33 billion in the fourth quarter ended Dec. 31, from $18.10 billion a year earlier. Analysts had expected $20.77 billion, according to Thomson Reuters I/B/E/S.

Revenue for Other Bets was $151 million, up 29.8 percent from $106 million in the same quarter last year, primarily from its smart-home monitoring unit Nest, Google Fiber, which provides high-speed Internet access, and its life sciences business Verily.

Adjusted earnings of $8.67 per share handily beat analysts’ average estimate of $8.10 per share.

In a call with analysts, Chief Financial Officer Ruth Porat attributed the strong earnings to “increased use of mobile search by consumers,” as well as “ongoing momentum” in YouTube and programmatic advertising, referring to the automatic buying of ads.

Kelly at Recon Capital said he would not be surprised if YouTube saw a surge in advertising revenues beyond the 17 percent increase it saw during the 2015 fiscal year.

Total operating losses on the Other Bets – which include glucose-monitoring contact lenses and Internet balloons - increased to $3.57 billion in the 12 months ended Dec. 31, and $1.2 billion in the fourth quarter.

The Google unit houses its Internet and related businesses such as search, ads, maps, YouTube and Android as well as hardware products such as its low-cost Chromebook laptops.

Google Chief Executive Sundar Pichai said on the call that its Gmail service crossed one billion monthly active users last quarter, joining Search, Android, Maps, Chrome, YouTube and Google Play in topping that mark.

He also touted the company’s performance during the holiday shopping season, saying that programmatic video impressions doubled this season compared to last, and that 60 percent of them came from mobile devices.

But Porat, without providing figures, said the company planned to accelerate capital expenditures in 2016 compared to the previous year.

Letters spell the word "Alphabet" as they are seen on a computer screen with a Google search page in this photo illustration taken in Paris, France, August 11, 2015. REUTERS/Pascal Rossignol

Google’s shares rose almost 5 percent in after-hours trading. Alphabet’s combined share classes were worth $549 billion, compared with Apple, which had a value of about $534 billion.

Alphabet will officially overtake Apple in market value if both companies’ shares open around current levels on Tuesday.

Google’s advertising revenue increased nearly 17 percent to $19.08 billion, while the number of ads, or paid clicks, rose 31 percent, the company said. Analysts had expected paid clicks to increase 21.8 percent.

Advertisers pay Google only if someone clicks on their ad.

Net income in the fourth quarter rose to $4.92 billion, or $7.06 per Class A and B share and Class C capital stock, from $4.68 billion, or $6.79 per share. (bit.ly/1WY8V19)

Adjusted earnings of $8.67 per share excluded certain one-time items.