Microsoft (Nasdaq: MSFT) Chief Executive Officer Steve Ballmer, who has struggled to adapt to an era of declining personal-computer sales, will retire after more than a decade leading the world’s largest software maker.

Ballmer, 57, plans to step down within the next 12 months, Redmond, Washington-based Microsoft said today in a statement. Microsoft’s lead independent director, John Thompson, will lead the search for his successor, heading a committee that will also include Microsoft co-founder Bill Gates.

Ballmer, who took over the CEO role from Gates in 2000, has been working to bolster Microsoft’s performance in areas like mobile computing as consumers gravitate to smartphones and tablets — and away from the PCs that have long been powered by Microsoft’s flagship Windows software. Last month, he presided over the biggest reorganization of Microsoft in a decade in a bid to speed development of hardware and services as the company’s Windows business suffers from the shrinking PC market and poor demand for Windows-based mobile devices.

“There is never a perfect time for this type of transition, but now is the right time,” Ballmer wrote in a memo to employees today that was posted on Microsoft’s website. “My original thoughts on timing would have had my retirement happen in the middle of our transformation to a devices and services company focused on empowering customers in the activities they value most. We need a CEO who will be here longer term for this new direction.”

Shares Rise

Microsoft shares rose 7.6 percent to $34.86 at 9:34 a.m. in New York. The stock had gained 21 percent this year before today.

Ballmer attended Harvard University with Gates. Unlike his schoolmate, who left the Ivy League institution before graduating, Ballmer stayed and received a degree in applied math and economics. He then joined Microsoft in 1980.

Ballmer was the world’s 47th richest person as of yesterday, according to the Bloomberg Billionaires Index, with a fortune of $16 billion.

Microsoft last month reduced the number of business units to four and said Windows chief Julie Larson-Green will oversee all hardware, including the Surface tablet and Xbox console and related games. Windows Phone software head Terry Myerson will add responsibility for the Windows and Xbox operating systems.

The shuffle reverses some changes Ballmer made in 2002 when he divided Microsoft into what was then seven individual product units, each led by an executive with operational and financial responsibilities.

Since then, he’s only tinkered with individual businesses. In 2011, Bob Muglia was pushed out as server chief, and in 2006 Ballmer revamped leadership of the Windows and Internet units after development delays for the Windows Vista operating system.