Yahoo! Inc. (Nasdaq: YHOO) and Facebook Inc. (Nasdaq: FB) settled a patent litigation case that began in March, while starting a new advertising partnership and strengthening distribution arrangements.

The settlement includes a cross-license agreement, according to a statement Friday. The companies said they will work together to bring advertisers ways to promote their products across Yahoo and Facebook’s websites. Facebook users will also get access to Yahoo’s media event coverage.

Yahoo filed the original lawsuit under the leadership of Scott Thompson, who resigned as chief executive officer in May amid pressure from investors, after failing to correct misstatements in his academic record. In the March lawsuit, Yahoo alleged that Facebook infringes patents covering such functions as Internet privacy, advertising and information sharing. Facebook, the largest social-networking service, countersued in April, accusing Yahoo of infringement.

Ross Levinsohn stepped in as interim chief executive after Thompson’s departure and is being considered as a permanent CEO, among other candidates, people familiar with the matter have said. Levinsohn and Sandberg helped work out the terms, according to other people familiar with the matter.

“We were able to resolve this in a positive manner and look forward to partnering closely with Ross and the leadership at Yahoo,” Sheryl Sandberg, Facebook’s chief operating officer, said in the statement. “Yahoo’s new leaders are driven by a renewed focus on innovation and providing great products to users.”

Suit, Countersuit

Yahoo, in the lawsuit filed March 12, sought an order barring Facebook from infringing 10 patents. It also sought triple damages. In the countersuit, Facebook accused Yahoo of infringing 10 patents through its home page and the Flickr-photo sharing service.
The end to the patent dispute may frees Facebook from potential challenges the social-network website warned investors about in March.

“If an unfavorable outcome were to occur in this litigation, the impact could be material to our business, financial condition or results of operations,” Facebook, which sold shares in an initial public offering in May, said in a March 27 filing.
Facebook, based in Menlo Park, California, rose less than 1 percent to $31.73 at the close, while Yahoo fell less than 1 percent to $15.78.

The advertising alliance could help Yahoo recover some of the revenue that it has been losing as marketers shift more of their spending to a larger and more engaged audience on Facebook’s online social network.

Under Thompson, Yahoo filed the patent lawsuit in March, wielding it as a weapon against a company that Thompson believed had been prospering from the ideas of its older rival. The complaint alleged that Facebook infringed on 10 Yahoo patents covering Internet advertising, privacy controls and social networks. Yahoo Inc. added two more patents to the lawsuit later.

But Thompson’s attack on Facebook Inc. quickly turned into a public-relations disaster. Much of the technology industry railed against Yahoo’s tactics. Critics viewed the lawsuit as a financial shakedown by a desperate company whose well of innovation had run dry.

New York venture capitalist Fred Wilson summed up the enmity toward Yahoo in an acerbic blog post that ended with this denouement: “I am writing this in outrage at Yahoo. I used to care about that company for some reason. No more. They are dead to me. Dead and gone. I hate them now.”

(Bloomberg and The AP contributed to this report.)