Gateway Inc. has agreed to pay $47 million to rival computer maker Hewlett-Packard Co. to settle a series of lawsuits over patents.

The two companies also entered into a cross-licensing agreement that lasts for seven years, said Joe Beyers, Hewlett-Packard’s vice president of intellectual property and licensing.