This Feb. 21, 2012 file photo shows a Hewlett Packard logo in Frisco, Texas. Hewlett-Packard said Wednesday, May 23, 2012 that it's laying off 27,000 workers, 8 percent of its work force, as it restructures the business. The Palo Alto, Calif., company said it'll save $3 billion to $3.5 billion annually from cost cuts, including the layoffs. Hewlett-Packard Co. expects to complete the job cuts by the end of fiscal 2014. (AP Photo/LM Otero, File)

(AP) -- Hewlett-Packard CEO Meg Whitman has quantified the painful price that must be paid for the missteps of her predecessors as she tries to turn around the Silicon Valley pioneer. The bungling will wipe out 27,000 jobs so HP can save enough money to lift its earnings and invest in the development of more profitable products and service.

The streamlining announced late Wednesday amounts to the largest payroll purge in Hewlett-Packard Co.'s 73-year history. About 8 percent of HP's nearly 350,000 employees are to be gone by October 2014.

The announcement came eight months after HP hired Whitman to turn the company around. The company expects to save $3 billion to $3.5 billion annually from the job cuts and other austerity measures. HP will try to reduce the number of layoffs by offering early retirement packages.

The somber news overshadowed the release of HP's latest quarterly results. Although HP's earnings and revenue declined from a year ago, the numbers were better than analysts had projected. HP delivered another pleasant surprise by offering a forecast that raised hopes that HP may be poised to bounce back.

"While I wouldn't say we have turned the corner, we are making real progress," Whitman told analysts during a conference call.

Investors were pleased, although it wasn't clear whether their glee had more to do with the cost-cutting or the company's performance during its fiscal second quarter, which ended in April.

HP shares surged $1.97, or more than 9 percent, to $23.05 in Wednesday's extended trading following the announcements.

They're still worth just half what they were before HP parted ways with Mark Hurd, a cost-costing specialist who stepped down in 2010 amid a scandal revolving around the nature of his relationship with a former actress who worked as an HP contractor. An investigation uncovered inaccurate expense reports.

The current troubles at HP have been traced both to Hurd and his successor, Leo Apotheker, who didn't respond to the threat posed by a shift to computing on smartphones and tablets.

Whitman's plan calls for less bureaucracy so the company can respond more quickly to customer needs. She also wants to boost research and development to spur innovation.

HP, which is based in Palo Alto, Calif., has been struggling to sell more personal computers and printers; demand has softened as people spend more time surfing the Web on phones and tablets such as Apple Inc.'s iPad. And the company's efforts to sell more business software and consulting services have been stymied by competition from the likes of IBM Corp. and Oracle Corp.

"Work force reductions are never easy," Whitman said Wednesday. "They adversely impact people's lives, but in this case, they are absolutely critical to the long-term health of the company. Our goal is simple: a better outcome for the customers at reduced cost for HP."

Whitman plans to funnel most of the savings from the job cuts into product development, with an emphasis on three areas: software services delivered online, a concept known as "cloud computing"; data storage and analysis; and computer security. Some of the extra cash will go toward boosting HP's earnings, too.

HP's work force has undergone several reorganizations during the past decade. Two of the biggest occurred during Hurd's regime. HP announced 14,500 job cuts in 2005 in one of his first big acts as CEO. A round of 24,600 cuts came in 2008 after HP bought technology consulting service EDS for $13.9 billion.

HP did not say where it would make the latest cuts. It is combining its printer and PC divisions, which could reduce some overhead.

In related moves, Whitman is changing the leadership at HP's recently acquired Autonomy division, which makes software that finds and analyzes data within companies and government agencies.

Bill Veghte, HP's chief strategy officer, is replacing Autonomy founder Mike Lynch in an effort to boost the division's financial performance. The shake-up is likely to amplify investor concern about whether HP blundered last year when it paid $11 billion for Autonomy. Apotheker announced the deal in August, just a month before he was fired.

Whitman told analysts she still believes the Autonomy acquisition was smart.

The company earned $1.6 billion, or 80 cents per share, in February through April. That's 31 percent less than the $2.3 billion, or $1.05 per share, it earned a year earlier.

Excluding one-time items, the company said it earned 98 cents per share. That topped the average estimate of 91 cents per share among analysts surveyed by FactSet.

Revenue fell 3 percent to $30.7 billion, but that was about $800 million above analysts' average projection.

To pay for severance and other restructuring costs, HP expects to take a pre-tax charge of about $1.7 billion in the current fiscal year, which ends in October. About $1 billon of those charges will come in the current quarter, which ends in July. HP expects to record $1.8 billion more in charges through fiscal 2014.

The company also expects to register a charge of $1.2 billion to account for the declining value of the Compaq computer brand. HP bought Compaq a decade ago in a deal that many shareholders, including the son of a company founder William Hewlett, tried to block.

Key moments in Hewlett-Packard's recent history

On Wednesday, Hewlett-Packard Co. announced plans to cut about 8 percent of its work force, or 27,000 workers, by October 2014. It comes as the maker of personal computers struggles to compete with mobile devices.

Here's a timeline of some key events in HP's history since it acquired the PC business:

- Sept. 3, 2001: HP announces it is buying fellow computer maker Compaq Computer in a deal that would create a formidable rival to IBM.

- May 3, 2002: HP and Compaq combine businesses following a contentious road to the acquisition, which was opposed by former director Walter Hewlett, the son of HP co-founder William Hewlett. The final acquisition price was $19 billion. HP added the letter Q to its ticker symbol to create "HPQ."

- Feb. 9, 2005: CEO Carly Fiorina steps down amid upheaval about the company's performance following her contested decision to buy Compaq.

- March 29, 2005: Mark Hurd named as new CEO. Starts job in April.

- May 1: IBM sells its personal computer division to Chinese computer maker Lenovo Group for $1.75 billion. IBM now focuses on consulting and software, outsourcing much of its manufacturing.

- July 19: HP announces plans to cut 14,500 jobs, Hurd's first big act as CEO.

- Sept. 22, 2006: HP Chairwoman Patricia Dunn is forced from the board over a disastrous investigation into boardroom leaks to the media that included spying on reporters' and directors' phone records.

- Aug. 26, 2008: HP buys Electronic Data Systems, which sells technology services, for $13.9 billion. A month later, HP announces plans to cut 24,600 jobs as part of integrating the businesses.

- Nov. 11, 2009: HP agrees to buy networking software and equipment maker 3Com Corp. in a $2.7 billion deal.

- April 28, 2010: HP agrees to buy struggling smartphone maker Palm Inc. for nearly $1 billion in cash. It says Palm's webOS operating system will help boost its participation in the mobile market.

- Aug. 6: Hurd resigns as CEO after investigation into a sexual harassment claim finds expense reports that were allegedly falsified to conceal a relationship with an HP marketing contractor.

- Sept. 30: HP names Leo Apotheker CEO. Apotheker was the chief of German business software maker SAP AG, which did not renew his contract after financial performance faltered. HP names Ray Lane, another CEO candidate, non-executive chairman. Lane is a partner at Kleiner, Perkins Caufield & Byers, a renowned venture capital firm.

- Jan. 20, 2011: HP shakes up board, replacing four of its members.

- May 3: Leaked memo from Apotheker shows the CEO warning of "another tough quarter" for the company, sending HP's shares sharply lower. The memo says management needs to "watch every penny and minimize all hiring."

- Aug. 18: HP announces it will discontinue its tablet computer and smartphone products and may sell or spin off its PC division.

- Sept. 23: HP fires Apotheker after just 11 months and replaces him with billionaire businesswoman and political aspirant Meg Whitman, who accelerates an internal review on the fate of the PC division.

- Oct. 27: HP says it will keep the PC division after all, saying that keeping it is right for the company, its customers, shareholders and business partners.

- Dec. 9: HP says that instead of selling its webOS mobile system or killing it off, it's making it available as open-source software that anyone can use and modify freely. HP says it still plans to develop and support webOS. In offering it to the open-source community, the company is hoping more mobile apps will be developed under webOS.

- Feb. 22, 2012: Whitman urges investors to be patient and talks of a "multiyear journey" for a turnaround. She says she has a good sense of what the company needs to do, but it will take time to fix HP's internal operations and make investments to grow in areas such as security services, information management and Internet-based systems known as cloud computing.

- March 21: HP says it will combine its PC and printers businesses. The move will save an unspecified amount of money as the company expects improved productivity and efficiency and streamlined customer support and supply chain.

- April 11: Estimates from research groups Gartner and IDC suggest that HP has regained much of the PC business it had lost during the period of indecision.

- Wednesday: HP says it plans to eliminate 27,000 jobs, the largest payroll purge in its 73-year history. The reductions will affect about 8 percent of its nearly 350,000 employees by the time the overhaul is completed in October 2014. HP hopes to avoid many layoffs by offering early retirement packages. The company expects to save as much as $3.5 billion annually from the job cuts and other austerity measures.