Hewlett-Packard Co. agreed to acquire wireless-networking company Aruba Networks Inc. in a deal valued at roughly $2.7 billion, expanding H-P’s capabilities in the mobile market.

H-P is offering $24.67 a share, a 1% discount to Aruba Network’s close on Friday, when the stock reached the highest level in nearly two years following a report about a possible deal. Including cash and debt, the companies valued the deal at roughly $3 billion.

...