Hewlett-Packard Co. reported fiscal first-quarter sales and profit that topped analysts’ estimates as the personal-computer maker won new orders for servers to run data centers.

Profit excluding certain costs in the period ended Jan. 31 was 90 cents a share on revenue of $28.2 billion, the Palo Alto, California-based company said today in a statement. Analysts had on average predicted profit of 84 cents and revenue of $27.2 billion, according to data compiled by Bloomberg.

Chief Executive Officer Meg Whitman is trying to reshape the 75-year-old company, which is headed for a third straight annual sales decline as the personal-computer market shrinks. Hewlett-Packard may be picking up orders for servers, the powerful machines that store and dish out data, as International Business Machines Corp. leaves the market by selling the unit to Lenovo Group Ltd.

“That could result in a dynamic where H-P could pick up more share,” said Amit Daryanani, an analyst at RBC Capital Markets. He has the equivalent of a hold rating on the company’s stock. “In servers I think they’ve done slightly better but nothing phenomenal.”

Hewlett-Packard shares rose as high as $31 in extended trading following the announcement. They earlier gained 2.5 percent to $30.19, leaving them up 81 percent in the past 12 months, compared with a 22 percent gain in the Standard & Poor’s 500 Index.

Second Quarter

Profit before certain costs in the second quarter, which ends in April, will be 85 cents to 89 cents a share, the company said today. That compares with the average analyst estimate for 89 cents.

PC shipments fell for a seventh straight quarter in the last three months of 2013, dropping 6.9 percent, as consumers continued to choose smartphones and tablets over laptops, according to researcher Gartner Inc. Hewlett-Packard had the No. 2 worldwide spot by unit sales, with 16.4 percent of the market — even as its shipments dropped 7.2 percent from a year earlier.

Whitman, who took over at Hewlett-Packard in September 2011, has been working to turn around one of Silicon Valley’s oldest companies, whose product range spans from PCs and home printers to the servers, networking gear and software used by corporations. Hewlett-Packard has fallen behind in mobile computing, where consumers have migrated to smartphones and tablets made by Apple Inc. and Samsung Electronics Co.

Corporate Computing

In corporate computing, Hewlett-Packard competes with EMC Corp., Oracle Corp., IBM and Dell Inc., all of which are confronting new challenges from startups offering simpler and cheaper technology.

“The issues they are facing are multiquarter fixes,” said Abhey Lamba, an analyst at Mizuho Securities USA Inc. in New York. “You’re not going to see some data points in a quarter or two to give you comfort.”

Lamba has the equivalent of a hold recommendation on the stock, a rating shared by 63 percent of the analysts covering Hewlett-Packard, according to data compiled by Bloomberg.

Whitman is also dealing with fallout from Hewlett-Packard’s $8.8 billion writedown of its 2011 acquisition of Autonomy Corp., an agreement struck by her predecessor, former CEO Leo Apotheker. The company said the writedown was triggered by accounting improprieties at the software maker. Former Autonomy CEO Michael Lynch denied the accusations.

Shareholders sued Hewlett-Packard over the writedown, alleging its board and Whitman ignored warnings of accounting irregularities. The company has begun talks with shareholders’ lawyers on a possible settlement of the litigation, a person familiar with the matter said yesterday.

Hewlett-Packard has provided information to the U.K. Serious Fraud Office, the U.S. Department of Justice and the Securities and Exchange Commission regarding accounting improprieties, disclosure failures and misrepresentations by Autonomy, before and during the acquisition, the U.S. company said in filings.