The software giant ended Friday with a market value of more than $851bn (£668bn) compared with Apple's $847bn.
The two firms have been vying for top place all week, with Apple remaining ahead at the end of each trading day.
But the iPhone maker, which has seen its share price plunge in recent weeks, finally lost its lead.
On Friday, Microsoft shares gained more than 0.6% to close at $110.89, while Apple shares finished at $178.60, down about 0.5%.
Apple's shares have fallen almost 25% since October - more steeply than the market overall - amid concerns about slowing smart phone demand and the possibility of additional US tariffs on Chinese-made goods.
The sell-off has erased more than $200bn from the firm's market value, which is calculated by multiplying the share price by the number of traded shares cited in the firms' most recent quarterly reports.
By many measures - including annual revenue and profit - Apple remains the bigger company.
For now, however, investors are betting that Microsoft's prospects are brighter.
The firm's cloud services unit, which sells to other businesses, has driven the firm's growth in recent years.
Apple, by contrast, depends on consumer spending, which investors are worried could slow.
Daniel Ives, managing director of equity research at Wedbush Securities, said Microsoft is poised for significant growth, as more companies sign up for the firm's cloud products.
Microsoft boss Satya Nadella is well-positioned to "further transform [Microsoft] into a cloud behemoth over the coming years," he wrote in a research note.