He will continue to serve as technology adviser to CEO Satya Nadella, according to the statement.
Gates stepped down "to dedicate more time to his philanthropic priorities including global health, development, education, and his increasing engagement in tackling climate change," according to the statement.
Shares of Microsoft fell $4.33, or 2.7%, to $154.50 in after-hours trading. The stock surged 14% during regular trading as markets gained after President Donald Trump declared coronavirus a national emergency and set plans to make $50 billion assistance available to companies and individuals affected by the economic slowdown.
Berkshire Hathaway class B shares fell $2.40, or 1.2%, to $194 in after-hours trading. The stock gained 12% in the regular session.