SAN FRANCISCO (Reuters) - Just four months after Apple Inc AAPL.O breached the $1 trillion mark, the iPhone maker has lost its lead as Wall Street's most valuable company and is on the verge of being replaced by Microsoft Corp MSFT.O.

Apple shares fell 1.77 percent in extended trade after U.S. President Donald Trump told The Wall Street Journal that tariffs could be placed on laptops and mobile phones imported from China.

The loss wiped out the 1.35 percent gain during the official trading session and put Apple’s stock market value at $814 billion.

Microsoft shares dipped 0.35 percent after-hours to $106.10, putting its market capitalization also at $814 billion. Microsoft had rallied by more than 3 percent during Monday’s official trading session, when the market notched broad gains.

Both companies’ market capitalizations were calculated using outstanding shares reported in their most recent 10-Q filings.

Trading after the bell is often volatile and lacks the volume typically seen in official trading sessions.

(Graphic: Microsoft vs Apple in market cap - tmsnrt.rs/2RaGujz)

Technology shares have been punished in recent months on investor worries about rising interest rates and fallout from the trade conflict between the United States and China.

But Apple has suffered more than other Silicon Valley stalwarts, down 23 percent since the iPhone maker warned on Nov. 1 that sales for the crucial holiday quarter would likely miss Wall Street expectations.

Global demand for smartphones has slowed in recent years, making it more difficult for Apple to increase its revenue.

Apple’s market capitalization overtook Microsoft’s in 2010 as the maker of Windows software struggled with slow demand for personal computers, due in part to the explosion of smartphones driven by the iPhone.

Since Satya Nadella took over as chief executive in 2014, Microsoft has reduced its reliance on Windows software for PCs and become a major player in cloud computing, second only to Amazon.com AMZN.O.

Thirty-three analysts recommend buying Microsoft’s stock, while just one has a negative rating and another has a neutral rating, according to Refinitiv data.