Microsoft’s customers flocked to game consoles and cloud software last quarter, helping Steve Ballmer deliver results that topped projections in his last months as chief executive officer.

Revenue climbed 14 percent to a record $24.5 billion in the fiscal second quarter, which ended Dec. 31, Microsoft said in a statement Thursday. Analysts had predicted on average $23.7 billion in sales, according to data compiled by Bloomberg. The shares rose.

Ballmer, who has said he would retire by this August, has kicked off Microsoft’s biggest transition in more than a decade. The world’s largest software maker is in the middle of implementing a reorganization and is working to close the acquisition of Nokia’s handset unit. Microsoft introduced the new Xbox One game machine in the holiday quarter and boosted sales of Web-based software such as Azure and Office 365, even as its traditional programs continue to languish along with personal-computer shipments, which posted a record drop in 2013.

“They continue to defy the skeptics,” said Brent Thill, an analyst at UBS AG in San Francisco who has a buy rating on the stock. “This company is outpacing every other large-cap enterprise company by miles. They’re doing the right things. The last part of this is you have to get the right head coach.”

Shares of Redmond, Wash.-based Microsoft climbed 3.4 percent to the equivalent of $37.27 in German trading at 9:04 a.m. Frankfurt time. They rose as much as 5.5 percent Thursday in extended trading following the report, after closing at $36.06 in New York. The stock added 40 percent in 2013, compared with a 30 percent increase in the Standard & Poor’s 500 Index.

Net income in the second quarter rose 2.8 percent to $6.56 billion, or 78 cents a share, from $6.38 billion, or 76 cents, a year earlier. Analysts had projected on average profit of 69 cents.

Unearned revenue, which comes from sales of multiyear deals that will be recognized in the future, was $19.5 billion for the quarter, compared with the $20.5 billion average analyst projection, according to data compiled by Bloomberg.

Sales of commercial cloud programs like Azure and Office 365 more than doubled from the year-ago quarter and the company sold twice as many Surface tablets as it did in the fiscal first quarter, according to Chief Financial Officer Amy Hood.

“We exceeded expectations in both the commercial unit and the devices and consumer segment and we saw improvement in areas where frankly we needed to get better,” Hood said in an interview, citing Surface and tablets as examples.

The PC market is stabilizing, she said, with corporate shipments rising for the third consecutive quarter and consumer PCs performing better than Microsoft anticipated, although she said demand remains soft as customers choose other devices.

Most investors are more focused on the CEO search than earnings results, according to Daniel Ives, an analyst at FBR Capital Markets & Co., who rates the stock the equivalent of a hold. The board is narrowing down candidates in a bid to make a final selection. The list includes Microsoft cloud-computing chief Satya Nadella, Ericsson AB CEO Hans Vestberg and former Nokia CEO Stephen Elop, as well as other outsiders, people with knowledge of the selection process have said.

“The fundamentals have taken a back seat to the CEO search,” Ives said.

Hood declined to comment on the executive change and didn’t provide an update on Thursday’s call with analysts. Ballmer, 57, said in August that he would retire within a year. Five months have now passed, and the new CEO will be stepping in at a crucial point as Microsoft moves away from its software roots.

Revenue in the devices and consumer hardware unit, which includes Xboxes and Surface tablets, climbed 68 percent to $4.73 billion, topping the $4.05 billion average estimate of analysts polled by Bloomberg. The company is forecasting third-quarter division sales of $1.9 billion to $2 billion.

Microsoft sold 7.4 million Xbox units to retailers, including 3.9 million Xbox One machines in the latest quarter, the company said. The console was the top seller in the U.S. in December, according to NPD Group Inc., regaining the lead after trailing Sony Corp.’s PlayStation 4 in November.

Microsoft is trying to boost growth by getting customers to adopt its Azure cloud services, which let companies store and run applications in data centers accessed via the Internet. The company is also moving corporate customers to Office 365, which includes cloud-based versions of its popular e-mail, word- processing and collaboration programs. Revenue in that unit was $1.78 billion. Analysts’ average projection was for $1.81 billion. Microsoft anticipates sales in that business of $1.8 billion in the third quarter.

The company’s contracted but unbilled balance, which reflects agreements that have already been signed and not yet billed, ended the quarter at more than $23 billion, a $2 billion increase from the previous period, Hood said.

Microsoft adopted a new financial reporting structure for the current fiscal year, organizing divisions around consumer, commercial and cloud sales instead of the company’s traditional products. That followed a July reorganization, which shuffled executives, staff and products into new groups to focus on a strategy of devices and services rather than just software.

Devices and consumer licensing revenue, which includes Windows and Windows Phone software, fell 5.6 percent to $5.38 billion. Analysts, on average, had predicted $5.28 billion. Commercial licensing revenue, or server software and corporate versions of Windows and Office, rose to $10.9 billion, compared with an analyst estimate for $10.8 billion. Surface sales more than doubled to $893 million, topping the $260 million estimate of Heather Bellini, an analyst at Goldman Sachs Group Inc.

“They were very good numbers,” said Kim Forrest, an analyst at Fort Pitt Capital Group Inc. in Pittsburgh, which manages $1.5 billion in assets including Microsoft shares. “The enterprise sales area looked pretty strong. Xbox was a winner this year and sales of Windows to PC makers weren’t as bad.”