SAN FRANCISCO (Reuters) - Apple is on the verge of becoming the first $1 trillion publicly listed U.S. company, but even if it gets there, it could soon be overtaken as Amazon.com surges from behind.

Started in the garage of co-founder Steve Jobs in 1976, the iPhone maker’s annual revenue has ballooned to $229 billion, greater than the gross domestic product of countries including Portugal and New Zealand.

(Big Tech Rev vs Countries' GDP: reut.rs/2ry9qr6)

Apple’s market capitalization on Thursday topped a record $934 billion, following its unveiling last week of a $100 billion buyback budget and news that Warren Buffett’s Berkshire Hathaway dramatically increased its stake in the company.

Thanks to a 12 percent rally since its quarterly report last Tuesday, the Cupertino, California company is just 8 percent short of hitting the $1 trillion valuation mark.

Pointing to Apple’s recent 31 percent jump in service revenue, including music streaming and online storage, CFRA analyst Angelo Zino on Wednesday upped his target price for the stock from $195 to $210, which would put Apple’s market capitalization at $1.03 trillion. Zino joins at least 12 other analysts with price targets putting Apple’s stock market value at 13 digits.

But Apple is in danger of being beaten to the $1 trillion mark - or passed soon after - by Amazon.com, the second largest listed U.S. company by market value, at $780 billion.

Saudi Arabian authorities, meanwhile, have said they expect a planned international initial public offering of Saudi Aramco that would value the national oil producer at about $2 trillion.

While $148 billion smaller than Apple on Friday, Amazon of late has expanded its stock price, and its sales, much more quickly than Apple. Amazon’s stock is red hot, trading recently at over 100 times expected earnings, compared to more-profitable - but slower growing - Apple’s valuation of 15 times earnings.

FILE PHOTO - Tim Cook, CEO, speaks about Amazon during Apple's annual world wide developer conference (WWDC) in San Jose, California, U.S. June 5, 2017. REUTERS/Stephen Lam/File Photo

(Big Tech PEs:reut.rs/2wsd0YU )

Apple’s stock has risen 24 percent over the past year, fueled by optimism about the iPhone X, the company’s latest smartphone. But demand for the $1,000 device has underwhelmed investors, and bulls are now focused on Apple’s plan to return more cash to shareholders.

By comparison, Amazon’s stock has surged 70 percent over the past 12 months, bolstered by 31 percent revenue growth as more shopping moves online and businesses shift their IT departments to the cloud, where Amazon Web Services leads the market.

Amazon is also competing more with Apple and Google owner Alphabet as it sells music and video content, its Fire TV device and its Alexa smart home gadget.

(Big Tech Revenue: reut.rs/2wyZaE4 )

At $765 billion, Alphabet has the third largest market capitalization on Wall Street, with Microsoft close behind at $749 billion. Amazon breezed past both them both in February.

(Long-Term Market Cap:reut.rs/2rzCGxD )

Including Facebook, the five largest listed U.S. companies now account for 15 percent of the S&P 500’s $24 trillion market capitalization.

(Big Tech's Outsized Weight in S&P 500: reut.rs/2rwBTOc)

To be sure, past stock gains are not a reliable predictor of future performance, and the surge in Apple’s and Amazon’s shares in recent years has been exceptional by most standards.

But if Apple’s stock were to keep growing at the pace seen over the past year, the company’s market capitalization would hit $1 trillion in September. Amazon would reach $1 trillion around October if its stock price continued to rise at the same rate as the past year, and overtake Apple soon after.

Extending forward their own one-year performances, Microsoft would not reach $1 trillion until early 2019, and Alphabet would take until 2020.

(Race to $1 Trillion Market Cap:reut.rs/2rz4WAJ )

Most Wall Street analysts are less optimistic. The mean analyst price target puts Apple’s stock 6 percent above current levels at $200 within the next 12 months, which would elevate its market capitalization to $983 billion, according to Thomson Reuters data.

The mean price target of analysts covering Amazon is $1,850, a 15 percent premium over its current price, which would give it a market value of $898 billion. Analysts target Microsoft to rise 12 percent to reach $845 billion, and for Alphabet’s market value to increase 16 percent to $884 billion.

(Big Tech Analyst Price Targets:reut.rs/2wv224H )