Struggling to reinvigorate its beleaguered business, Hewlett-Packard (HPQ) on Thursday reported earnings that were worse than a year ago but beat Wall Street's expectations.

The company posted a profit of $1.2 billion on sales of $28.4 billion for its first fiscal quarter. That was down from a profit of $1.5 billion and sales of $30 billion from the same period a year ago.

Nonetheless, its sales and earnings of 63 cents a share exceeded the forecasts of analysts surveyed by Thomson Reuters. They generally had expected 38 cents a share on sales of $27.8 billion.

"This is positive news," said Neil MacDonald, a vice president and fellow with market research firm Gartner, noting that Meg Whitman -- who has been the Palo Alto company's CEO for about a year and a half -- seems to be slowly putting the company back on track. "It should reassure investors and customers."

Given HP's many problems in recent years, "we were relieved there were no major negative surprises in this quarter's report," analysts at International Strategy & Investment added in a note to clients.

Whitman was cautiously upbeat during a conference call to discuss the company's finances.

"We did better than expected. This is tangible proof that we have the right plan in place and we're successfully delivering on it," she said, adding, "the patient showed some improvement."

But "the results in the first quarter were not what we would want them to be," she acknowledged. "We clearly still face a long road ahead and there is a lot we have to fix and rebuild."

HP reported its earnings before the stock market's official close. In after-hours trading, its shares rose 99 cents, or more than 5 percent, to $18.09.

Though it is one of the nation's most storied technology giants, HP has gravely disappointed many analysts and investors in recent years. Its sales have flattened, its profit and stock price have slumped, and to get its expenses under control it recently announced plans to jettison 29,000 jobs over the next couple of years.

Most recently, it has endured intense criticism after revealing three months ago that it was taking an $8.8 billion write-down for its $11 billion purchase of Autonomy, a problem HP blames on the software firm's value being grossly misrepresented.

Analysts also have faulted HP for being unfocused. It sells everything from networking switches, routers and data storage devices to calculators, software and printers. Especially worrisome is that much of its revenue comes from sales of personal computers, which are fast being supplanted by smartphones and other mobile gadgets.

On Wednesday, research firm IHS warned that notebook shipments from manufacturers "will endure a bleak first quarter and slow first half in 2013," before sales of so-called ultrabooks should perk up in the second half.

Hoping to counter the slowdown in PC sales, HP recently introduced a tablet. And after having no luck selling smartphones a few years ago, it is again developing one. Even so, some industry observers have urged the corporation to spin off its PC division.

"Our thesis is that either Meg Whitman improves company performance over the next 12 to 18 months or the board (or activists) will break up the company," Bernstein Research analysts concluded in a note this week to clients.

But as she has done in the past, Whitman dismissed that idea during the conference call.

"We have no plans to break up the company," she said, adding that most of HP's customers she'd heard from favor keeping the corporation in one piece.

One promising niche for HP is its computer networking products, which have sold well lately. Moreover, Whitman is pushing HP to invest more heavily in cloud computing -- which helps businesses operate on the Internet -- as well as in products to deter hackers and to analyze vast amounts of information.

Even so, J.P. Morgan analysts recently advised their clients that "HP faces an uncertain growth profile," adding its turnaround "is likely to be measured in years."

Contact Steve Johnson at 408-920-5043. Follow him at Twitter.com/steveatmercnews.