Microsoft has surpassed Exxon to become the second-most valuable company in the world.
Exxon's shares have been falling recently, along with the price of oil.
Microsoft's shares have been rising since October. That month, the software company reported strong fiscal first-quarter results as its cloud computing business grew.
The companies swapped places Thursday, when Exxon's market capitalization dipped to $400.8 billion from $403.9 billion the day before.
In afternoon trading Friday, Microsoft Corp. shares rose 20 cents to $49.81, giving it a market capitalization of $410.5 billion. Exxon Mobil Corp. shares rose 24 cents to $94.90, giving it a market capitalization of $401.9 billion.
Apple Inc. remains the world's the most valuable company. The iPhone maker has a market capitalization of $668.2 billion.