PALO ALTO, Calif. (AP) — Hewlett-Packard Co. said Wednesday it has agreed to buy networking software and equipment maker 3Com Corp. in a deal the companies valued at $2.7 billion.

HP also issued a preliminary report Wednesday for the three months that ended in October. On an adjusted basis, HP said it earned $1.14 per share, about 11 percent higher than a year ago. Revenue fell 8 percent from the same period a year ago, to $30.8 billion.

By both measures, HP did better than Wall Street was expecting, according to a Thomson Reuters poll.

HP is the world's largest computer maker and the economic downturn has been a drag on two of its core businesses, PCs and printer ink. The 3Com acquisition is the latest move by HP to branch out into other areas. Last year, the company bought Electronic Data Systems Corp., making its high-margin technology services group its biggest revenue and profit generator.

The 3Com products will be folded into HP's own networking equipment business. HP said the deal will add new products to its line and help expand its presence in China.

HP also said in a statement that customers want more than one vendor in a sector dominated by Cisco Systems Inc.

The company said it will give 3Com stockholders $7.90 per share. Both HP's and 3Com's boards have approved the deal, which HP expects will close in the first half of 2010.

3Com is based in Marlborough, Mass. In the most recent quarter, it had $290.5 million in revenue.