Alphabet on Thursday reported quarterly earnings that beat analysts' expectations.
The parent company of Google posted earnings of $8.42 a share on $21.5 billion in revenue. Quarterly sales rose 21 percent year over year. Wall Street expected the company to report earnings of $8.04 a share on $20.76 billion in revenue, according to a Thomson Reuters consensus estimate.
CFO Ruth Porat said in a statement that the results "reflect the successful investments we've made over many years in rapidly expanding areas such as mobile and video."
Both Class A and Class C shares of Alphabet gained more than 4 percent in extended trading. The former briefly traded above its record intraday high of $810.35. The Class A shares have since pared those gains.
Last year, Google's founders changed the company's structure, creating Alphabet as a holding company of sorts. Core Google generates most of the company's money, and a separate category called "other bets" includes projects like Google Fiber, Nest Thermostats, science initiatives Calico and Verily, and the investment arm Google Ventures.
Alphabet reported that revenue for the latter segment came in at $185 million for the quarter, above analyst expectations of $168.2 million in revenue, according to a StreetAccount consensus estimate.
One of the projects in the "other bets" category is Alphabet's self-driving cars. During the company's Thursday afternoon earnings webcast, Porat said the company is now testing driverless cars in Mountain View, California; Austin, Texas; Kirkland, Washington, and Phoenix. She added that the company has conducted self-driving tests that total more than 1.6 million miles.
Porat said that Alphabet's approach to driverless cars is different from the way other companies are approaching the space.
"We're focused on fully autonomous cars because in early testing we saw the risk of depending on drivers to remain engaged once you give them the option to switch off. So we've invested a lot there. We're testing extensively based on this approach," she said.
Alphabet said its advertising revenue increased 19 percent to $19.14 billion. Aggregate paid clicks grew 29 percent from the same period last year, while paid clicks on Google websites were up 37 percent year over year.
This earnings report likely "assured investors so far today that they are continuing to grow at very healthy growth rates," said Aaron Kessler, senior vice president of equity research of Raymond James. Kessler also said Google is likely to profit from shifts in the entertainment industry.
"Google clearly still benefits on the video side with their YouTube offering. You're seeing a lot of video dollars flow to the internet, and I think YouTube is getting a nice share of that flow as well as surge," Kessler, said during an interview on CNBC's "Closing Bell."
Google CEO Sundar Pichai said that while the company doesn't have any new metrics to share, he believes engagement on YouTube is healthy.
"We reach more [people] 18 to 34 and 18 to 49 than any other TV network, broadcast or cable. Every indication we see is that the growth is very, very strong and being driven by mobile. It's growing globally as well," he said during a Thursday earnings webcast.
In the second quarter, Alphabet repurchased 2.0 million shares of its Class C capital stock for a total amount of $1.4 billion, the company said.
Disclosure: Raymond James expects to receive or intends to seek compensation for investment banking services from Alphabet in the next three months.
— CNBC's Ari Levy and Arriana McLymore contributed to this report.