With the digital advertising market booming and demand for smartphones waning, Google's parent company, Alphabet Inc., is poised to dethrone Apple as the world's most valuable company.

If it happens, Alphabet will move to the head of the class just five months after Google reorganized itself under the holding company.

The Silicon Valley rivals could trade places as early as Friday, given how rapidly the financial gap between them is narrowing. At the end of trading on Thursday, Apple's market value stood at $522 billion; Alphabet's was at $515 billion.

The competition wasn't even close 13 months ago. Since then, though, investors have soured on Apple amid signs of slumping iPhone sales while embracing steady growth and increased financial discipline at Google and Alphabet.

(Copyright 2016 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.)