It was a tale of two companies.

Alphabet, Google’s parent company, and Apple have been locked in a contest for the most valuable company in the world for the past few years.

The iPhone maker held the top spot for the past four years after taking the title from Exxon Mobil in 2012. Apple was valued at $760 billion in early 2015.

But the two companies switched places when Google posted its fourth-quarter earnings from 2015. Alphabet’s market cap is now approximately $547.1 billion compared to Apple’s $529.3 billion.

Alphabet’s explosive growth has been driven primarily by growth in advertising and mobile search options, as well as its ownership of YouTube. YouTube says that the number of people per day who watch videos on the site has increased by 40 percent since March 2014.

"Our very strong revenue growth in Q4 reflects the vibrancy of our business, driven by mobile search as well as YouTube and programmatic advertising, all areas in which we've been investing for many years," Alphabet CFO Ruth Porat said in a press release.

Google also saw the share of people who use Gmail cross the one-billion mark in the fourth quarter of last year, according to CEO Sundar Pichai. Advertising revenue at YouTube also grew during the year, by 17 percent.

In October 2015, Google established Alphabet as its parent company and separated its riskier ventures, like self-driving cars and the Project Loon internet balloon system, from its more profitable suite of products like YouTube.

That move seems to have paid off. The operating costs for Alphabet’s “Other Bets” increased from approximately $1.9 billion to around $3.6 billion for the twelve months ending in December. Its revenue, however, only increased from $327,000 to $448,000. The segment revenues for Google, on the other hand, increased from $65,674 to $74,541.

The last time Google overtook Apple as the most valuable company in the world was in 2010. Until mid-2015, Apple’s position of dominance was relatively secure thanks to its ability to consistently churn out innovative products, like each new iteration of the iPhone.

Get the Monitor Stories you care about delivered to your inbox. By signing up, you agree to our Privacy Policy

But Apple has relied on the core product that drives the bulk of its revenue for so long that iPhone sales are beginning to dip. Morgan Stanley now projects a six-percent decline in iPhone sales in 2016, and other banks have made similar assessments. Apple stocks have also been on the decline since the summer.

But while Apple may no longer hold the number one spot, it is still ahead of Microsoft (valued at $425.7 billion), Facebook ($326.2 billion), and Exxon Mobil ($310.1 billion). And while iPhone sales are showing signs of slowing down domestically, abroad they’re starting to heat up, particularly in India. Although the iPhone market is more mature in China, demand there is expected to remain relatively high, according to the Morgan Stanley report.