HP's future plans also include no longer selling smartphones and tablet computers and refocusing on selling software.
HP shares fell 20% in Friday trading to close at $23.58.
HP's Â£7.1bn ($11.7bn) offer for Autonomy, accepted by Autonomy's board, is 64% above the firm's market value.
HP's PC business is the world's largest, but by the end of next year, HP computers could be sold under another company's name.
Analysts say the move underscores Apple's dominance in smartphones and tablets with its iPhone and iPad products.
"Apple single-handedly knocked HP out of the PC, smartphone and tablet business," said Gleacher & Co analyst Brian Marshall.
The new strategy means that HP, which will continue to sell servers and other equipment to business customers, will follow the path taken by IBM in 2005, sidelining PC hardware in favour of more profitable software and services.
By Tim WeberBusiness editor, BBC News website
Chief executive Leo Apotheker had big ambitions for the consumer market. He wanted HP to become "as cool as Apple", challenge the iPhones, iPads and Android smartphones of this world with his Touchpads and Pre phones.
To Mr Apotheker's credit, he quickly realised that he could not out-apple Apple.
HP is leaving the PC business with its razor-thin margins to focus on highly profitable computing for  businesses instead.
This is where the purchase of UK software firm Autonomy fits in.
Companies have one big IT problem right now: how to process, store and understand the rapidly growing data deluge that is flooding in from ever more connected devices and web services.
Autonomy has been pushing hard in this field of "business intelligence" and "business analytics". It will be Mr Apotheker's challenge to integrate successfully such a big new division with HP's other software offering.
Analysis in full: HP's U-turn
Analyst Milan Radia at Jefferies said the deal gave HP an "exceptionally strong starting point" in the enterprise software market.
"Today, software accounts for only about 2% of HP's revenue," he said. "By way of comparison, IBM's software journey only commenced in 2001 with a $1bn acquisition, followed by a series of major transactions."
Autonomy was set up by researchers at Cambridge University and specialises in pattern-recognition technologies.
HP will pay 2,550 pence per share, compared with a closing price in London on Wednesday of 1,558p.
The implied valuation of the company is equivalent to 47 times the pre-tax profits earned by Autonomy in the 12 months to June this year.
Meanwhile, on Thursday, HP announced quarterly results that were largely in line with expectations, with revenues of $31.2bn (Â£18.9bn), up 1.6% from a year earlier.
HP trimmed its maximum full-year forecast from $130bn to $127.6bn, echoing a similar reduction by Dell on Tuesday.
Shares in Hewlett-Packard have fallen sharply on news that it is buying UK software firm Autonomy and may sell its PC business.