Microsoft Corp.'s stock market value surpassed Apple Inc.'s and pulled ahead by as much as $3 billion on Wednesday as the Windows software maker benefited from optimism about demand for cloud computing services.

Shares of Microsoft jumped 3 percent, pushing its market capitalization up to $848 billion. With the broad market rebounding following a recent slump, Apple also rose, but less than Microsoft. Its 2.17 percent increase put Apple's market capitalization at $845 billion, just four months after the iPhone maker breached the $1 trillion mark for the first time.

Microsoft and Apple briefly traded at about the same level after the bell on Monday, but Microsoft's intraday lead over Apple on Wednesday was more substantial.