Microsoft CEO Steve Ballmer announced Friday that he will retire within the next 12 months.

"There is never a perfect time for this type of transition, but now is the right time," Ballmer said. "We have embarked on a new strategy with a new organization and we have an amazing senior leadership team."

Microsoft unveiled its latest reorganization a month ago, hoping to better align the company's organizational structure with its new corporate strategy. Ballmer wants Microsoft to transition to a "devices and services" company, focusing on making hardware, online services and apps that work together seamlessly across multiple screens and gadgets.

Ballmer said he originally had planned to retire in the middle of the company's latest transition plan, but he felt the company needed a longer-term CEO who would be able to see Microsoft through its restructuring.

No successor for Ballmer was named. Bill Gates, Microsoft's founder and chairman, will be involved in the hiring process.

"I'll work closely with the other members of the board to identify a great new CEO," said Gates. "We're fortunate to have Steve in his role until the new CEO assumes these duties."

Investors have criticized Ballmer for failing to groom a successor. Virtually every Microsoft executive who was an heir apparent seemed to fly too close to the sun and ended up retiring or being forced out. Windows Chief Steve Sinofsky and Software Chief Ray Ozzie are recent prominent examples.

Though Devices Chief Julie Larson-Green seems to be an obvious CEO candidate, many analysts are clamoring for Microsoft to consider an external candidate who could help the company transition away from the PC.

Infographic: A tale of two Microsoft CEOs

Ballmer has had a rocky tenure as CEO, a role he took over from Gates in 2000. The company was once the most valuable in the world, but Microsoft has lost more than half of its market value over the past decade. During that time, the stock has failed to gain any traction, mostly wavering between $25 and $35 a share.

Investors have been critical of Ballmer for failing to anticipate the mobile computing revolution. Microsoft trails Apple(AAPL) and Google (GOOG)in the world of mobile software and devices.

Its late-to-the-game attempts to get the company into the mobile arena have largely fallen flat: Windows Phone is critically acclaimed but has gained poor traction among consumers. The Surface tablet -- the first PC of Microsoft's own design -- sold so poorly that Microsoft was recently forced to take a $900 million writedown on excess Surface inventory.

Mobile is only the latest bust for Ballmer. There was the Zune, Microsoft's ill-fated attempt to get into the once-hot MP3 game dominated by Apple's iPod. Despite a search partnership with Yahoo(YHOO), Microsoft still has been unable to generate profits from its Bing search engine and other online properties.

And of course, there was Windows Vista, a disastrously buggy PC operating system that tarnished the company's reputation. The latest version, Windows 8, has so for been poorly received, as consumers have found it difficult to master the completely redesigned operating system. But Microsoft responded to some complaints with an update, dubbed Windows 8.1, that is expected to launch in October.

But there have been many hits during Ballmer's tenure as well. Windows 7 was the fastest-selling operating system of all time. Xbox and Kinect did the unthinkable last year, taking the lead in the video game world. And Microsoft's cloud and enterprise businesses have remained strong throughout the past decade.

Microsoft supported Ballmer throughout. Gates and Ballmer are longtime friends, and Ballmer was one of the first 30 employees to join the company.

"This is an emotional and difficult thing for me to do," Ballmer wrote in a letter to employees. "I take this step in the best interests of the company I love; it is the thing outside of my family and closest friends that matters to me most."