High internet advertising sales offset spending on new unprofitable products and projects for internet giant Alphabet Inc. resulting in revenues and profits much higher than analysts predicted.

Revenue, not including payments to partner sites, went up to $18.3 billion, according to the company in a statement on Thursday with profits before certain items rising to $9.06 per share. The figures were above analysts’ projections of $18 billion and $8.61 profit per share. Shares rose higher in extended trading.

The core advertising business of Google was more than enough to offset their Other Bets, which are long-term projects with high risk like Fiber internet service and autonomous vehicles. Senior executives have however left some of these projects in recent months.

Google gave new ad features for mobile devices in order to boost the capabilities of its main source of income. The new tools, along with higher advertising spending on the company’s YouTube video service are expected to help the company to continue growing. Last quarter’s results showed an increased number of clicked ads by as much as 42 percent as more companies pay for ads on YouTube, according to an Alphabet executive.

“Online video is the biggest online ad growth driver and YouTube is the premier vehicle to play that trend,” Brian Fitzgerald, an analyst at Jefferies LLC said.

The company also said that it is going to repurchase $7 billion of its Class C stock.

Shares of the company rose by 4 percent in extended trading after the release of the report, a reversal from their drop of less than 1 percent at New York closing to $817.35. For the year, the stock has increased by around 5 percent.

“Mobile search and video are powering our core advertising business and we’re excited about the progress of newer businesses in Google and Other Bets,” Chief Financial Officer Ruth Porat said in a statement.

According to investors, the company’s enterprise business is one thing to watch out for. The business is being highlighted by Google as it tries to match up to larger rivals including Inc. and Microsoft Corp. for the business software and cloud services sector.

Other revenue streams for Google, including enterprise business, increased by 39 percent in the third quarter to $2.4 billion.

Google’s Other debts division, however, has been hemorrhaging money due to their ambitious and risky nature. Porat claims that it is necessary for the company to continue such investments as they try to get into new industries.

The Other Bets division garnered revenues of $197 million during the last period. However, operating losses were much higher at $865 million as the company continues to make significant investments.