File photo illustration of man using the camera of a Nokia Lumia 820 smartphone in the central Bosnian town of Zenica, September 3, 2013. (Dado Ruvic/REUTERS)

Microsoft, still struggling to make its way through a major revamp, beat expectations Thursday, reporting an unexpected jump in second-quarter profit with the help of strong holiday sales of its Xbox One.

Its Surface tablet — which launched to lukewarm reviews and poor sales last year — brought in $893 million in revenue, twice as much as last year. Those strengths helped offset “continued softness” in the PC market, which analysts say declined during the holiday season for the first time in more than five years.

“Our commercial segment continues to outpace the overall market, and our devices and consumer segment had a great holiday quarter,” chief executive Steve Ballmer said in a statement.

But Microsoft remains a company in search of itself at a time when it can’t afford to wait.

It’s in the fifth month of a search to replace Ballmer and faces waning interest in its core desktop market as it tries to make up ground in mobile technology.

Both problems will be daunting for whoever steps into the company’s top role. Ballmer has made some progress by integrating services from across the company — from Windows, Office, Xbox and now Nokia — to offer consumers a more complete package.

Microsoft’s strong consumer device sales could be seen as an endorsement of the new structure; they helped produce strong second-quarter earnings.

Quarterly profit was $6.5 billion on $24.52 billion in revenue, which topped revenue expectations of $23.6 billion.

The company’s stock rose as much as 5 percent in after-hours trading, hitting about $36 a share.

But with Ballmer on the way out, it’s not clear how long Microsoft will remain on the path he set. Speculation on possible replacements has yielded a list of people, including Nokia’s own Steven Elop and eBay’s John Donahoe, who may have their own ideas. Microsoft’s board has offered few updates as the clock ticks down on Ballmer’s tenure.

Even when the company names a new chief executive, it will still need time to set a new direction, anlaysts say.

The “new CEO is likely to take the remainder of this current fiscal year before making material changes,” said Colin Gillis of BGC Financial in a note to investors.

And minor successes still illustrate how far the firm has to go to unseat Google or Apple in the mobile world — particularly in the smartphone market.

Prospects there, for now, are dim. Microsoft has poured considerable effort into making up for its late start in mobile devices with prime-time product placement, products aimed at several market segments and ad campaigns that set smug Windows phone users apart from the Apple-Android wars. International Data Corp. reported in November that Windows phone shipments had more than doubled but were still only 3.6 percent of all smartphone shipments in the third quarter.

To pick up growth, Microsoft paid $7 billion for Nokia’s mobile device division in September. The deal is set to close this quarter. Yet Nokia reported a disappointing 29 percent drop for its Windows-powered smartphones from the same period last year because of stiff competition in the lower end of the smartphone market.