Facebook Inc. and Yahoo Inc. have agreed to settle a patent dispute, averting a potentially lengthy battle over the technology running two of the internet’s most popular destinations.

In dropping the lawsuits, the companies agreed to license their patents to each other. They are also agreeing to an advertising alliance that expands their existing partnership. Friday’s settlement involves no exchange of money.