According to sources close to the situation, the agreement will include a major expansion of their ongoing partnership, including a joint advertising sales effort, as well as cross-licensing of some key patents between the pair.

The deal has gotten approval from the companies’ boards — in fact, Yahoo’s directors agreed to it this morning in a telephonic meeting. It will be announced sometime later today.

But sources said Facebook and Yahoo hope there will be significant upside in several possible advertising and other business deals between the pair that could yield large revenues if executed well.

In addition, there is a possibility that Facebook could later pay to license other Yahoo patents not included in this deal.

Discussions to settle the lawsuits — negotiated by Yahoo interim CEO Ross Levinsohn and Facebook COO Sheryl Sandberg, among others — began almost as soon as Yahoo’s board ousted former CEO Scott Thompson, which I reported on in early June and Yahoo officially confirmed several weeks later in a regulatory filing.

The lawsuit was initially waged by Thompson, who reportedly promised directors that a big financial payoff of many billions of dollars could result from the patent lawsuits against Facebook.

At the time, despite strong support by its legal execs, many other Yahoo managers — including those who had crafted an earlier and successful content- and data-sharing agreement with Facebook — were blindsided by the aggressive move by Thompson. That included Levinsohn — who was then in charge of its global media unit — and other top execs.

So, after Thompson was gone and with board support, Levinsohn immediately reached out to Sandberg. In addition, Yahoo’s point person on the deal, VP of strategy James Heckman, met with a number of top Facebook execs including: Dan Rose, VP of business development and monetization; VP of global marketing solutions Carolyn Everson; and business development director Chris Daniels.

Such an outreach was a major shift for Yahoo, but was possible due to a newly configured board in the wake of the Thompson departure.

Still, some directors who had pushed for the initial lawsuit that Yahoo unexpectedly lobbed against the social networking powerhouse in March have remained on the board and agreed to the latest settlement.

The reason for the change of heart? While many still felt Yahoo had a strong case, backed by important intellectual property in a range of key digital arenas, Facebook was prepping for a long and expensive battle by girding its patent defenses.

Thus, the possible end of the rancorous legal battle should be greeted with enthusiasm by Wall Street investors, as well as many detractors of Yahoo’s legal action across the tech landscape.

And, indeed, the company’s reputation definitely suffered as a result of the lawsuit, with many techies, both inside and outside the company, decrying Yahoo’s lawsuit.

Many of those engineers, as well as entrepreneurs — key constituencies for Yahoo’s revival — firmly believe a patent portfolio should only be used defensively.

Now, if the deal is approved, the move will have been turned a decidedly negative situation into a potentially stronger partnership.

Among the most notable parts of the deal is an arrangement to jointly sell big events and other packages to advertisers.

In addition, as it has in content, Facebook will allow Yahoo to be the first partner to feature information about its users’ “Likes” in actual display advertising on Yahoo.

Extending and adding to such contact-sharing was apparently one bone of contention in the talks to settle the lawsuits, although there had already been an element of that in a previous partnership between the pair. Yahoo is one of the few Facebook partners with access to information from its social graph; Facebook, in turn, gets user contact data from Yahoo.

Of course, how well the pair works together to deliver better experiences for its consumers and marketing for its advertisers remains to be seen.

But it’s clear that any rocky road in cooperation is much better than the legal quagmire both had been stuck in.

One thing is likely — the successful end to the tensions ups Levinsohn’s chances of getting the permanent CEO job. Directors have not given him the nod as yet, with another candidate — Hulu CEO Jason Kilar — as Levinsohn’s leading rival for the job, as I first reported yesterday.

AllThingsD by Writer

AllThingsD.com is a Web site devoted to news, analysis and opinion on technology, the Internet and media. But it is different from other sites in this space. It is a fusion of different media styles, different topics, different formats and different sources. Read more »