Microsoft has said its chief executive, Steve Ballmer, will retire within the next 12 months, once it has selected a successor, sending its shares up almost 9%.

Ballmer said in a statement on Friday that he would have timed his retirement in the middle of Microsoft's announced transformation to a devices and services company. But he said: "We need a CEO who will be here longer term for this new direction."

The software company said its board had appointed a special committee to direct the process of appointing a new chief executive.

The committee is chaired by John Thompson, the board's lead independent director, and includes Microsoft founder and chairman, Bill Gates, as well as other board members Chuck Noski and Steve Luczo.

It will consider both external and internal candidates and is working with executive recruiting firm Heidrick & Struggles International, according to the company.

Microsoft shares rose by 8.9% to $35.27 in pre-market trading.

In an email to Microsoft employees, Ballmer said: "There is never a perfect time for this type of transition, but now is the right time. 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."

He said he was proud of what he had achieved at the company: "We have grown from $7.5m to nearly $78bn since I joined Microsoft, and we have grown from employing just over 30 people to almost 100,000. I feel good about playing a role in that success and having committed 100% emotionally all the way. We have more than 1 billion users and earn a great profit for our shareholders. We have delivered more profit and cash return to shareholders than virtually any other company in history."