(Reuters) -- Hewlett Packard Co outlined a plan Wednesday to lay off roughly 27,000 employees, about 8 percent of its workforce, to jumpstart growth.

The layoffs, which will be mainly achieved through early retirement, will generate annual savings of $3 billion to $3.5 billion as it exits fiscal 2014, the company said.

The world's No. 1 personal computer maker, which employs more than 300,000 people across the globe, also reported a 3 percent decline in quarterly revenue.

The job cuts, savings from which would be reinvested in the company, are necessary to improve execution and to fund the long term health of the company, Chief Executive Meg Whitman said in a statement.

The company will take a pretax charge of $1.7 billion in fiscal 2012 because of the cost-cutting plan, it said.

HP said net revenue in the fiscal second quarter fell to $30.7 billion. Analysts had predicted revenue of $29.92 billion on average, according to Thomson Reuters I/B/E/S.

HP shares were up 6 percent at $22.35 after hours from a close of $21.08.

(Reporting By Poornima Gupta; Editing by Bernard Orr)