Microsoft Corp. said Friday that longtime Chief Executive Steve Ballmer has decided to retire within the next 12 months, a move that comes a month after he unveiled a shift in focus for the tech giant. Mr. Ballmer, who is 57 years old, will depart after a successor has been chosen. The company's board has appointed a special committee that includes Chairman Bill Gates to find a new CEO, and will consider both external and internal candidates. Microsoft shares were up sharply in early trading. Under Mr. Ballmer, Microsoft has endured years of investor criticism as the rise of mobile devices and Internet services eroded the influence of the personal computer-era kingpin. The company has responded to the pressures in a variety of ways already, including developing and selling its own tablet-style computer in competition with longtime partners. "There is never a perfect time for this type of transition, but now is the right time," Mr. Ballmer said in a prepared statement.