When Yahoo sued Facebook for allegedly infringing 10 patents on social networking and related technologies, it was obvious Facebook would strike back. And Facebook did so quickly, accusing Yahoo of infringing 10 patents of its own, including four that Facebook was able to acquire after Yahoo launched its lawsuit.

Now Yahoo claims Facebook is playing dirty. Not only is Yahoo accusing Facebook of infringing another two patents, Yahoo says Facebook is getting its patents from patent trolls.

"Facebook purchased eight patents from non-practicing entities," Yahoo said in response to Facebook's counterclaim filed today in the US District Court in San Francisco. A "non-practicing entity" is the quasi-polite term for what many people call patent trolls, organizations that enforce patent claims against others without actually producing any technology of their own.

Facebook did, indeed, buy eight of the ten patents it's asserting against Yahoo from other organizations. Three of the patents were initially assigned to New York University researchers, while the rest came from companies most people haven't heard of. Yahoo says this indicates Facebook is not acting in good faith.

The 10 patents asserted against Facebook by Yahoo included three assigned to Overture Services, a company Yahoo purchased. The rest were filed by Yahoo in-house.

"In retaliation for Yahoo!’s good faith allegations of patent infringement, Facebook alleges infringement of ten patents as counterclaims," Yahoo wrote in today's court filing. "However, on information and belief, Facebook lacks a good faith basis for most, if not all, of its counterclaims, particularly those patents that it purchased from others."

Specifically, Yahoo notes that "two patents were purchased [by Facebook] from 'IPG Electronics 503 Limited,' a San Diego-based patent aggregator; two patents were purchased from 'Cheah Intellectual Property Licensing,' a California-based patent holding company; one patent was purchased from 'Right Point LLC,' a Texas-based patent aggregator; and three patents were purchased from New York University's intellectual property licensing department."

The eight patents were purchased by Facebook in the last five months. "On information and belief, many, if not all, of these patents were acquired by Facebook for purposes of retaliation against Yahoo! in this case," Yahoo wrote.

By the way, here are two more patents you infringed

For good measure, Yahoo added two new claims to its patent infringement lawsuit, bringing the count to 12. The new allegations are that Facebook infringes patent #7,933,903, covering a "system and method to determine the validity of and interaction on a network," and #7,698,315, covering a "System and method allowing advertisers to manage search listings in a pay for placement search system using grouping."

Yahoo filed for the patents in 2010 and 2006, respectively. Facebook Ads and other unnamed Facebook products infringe these patents, Yahoo claimed. Yahoo asked the court for declarations that all of Facebook's counterclaims are invalid, and financial damages for Facebook's alleged infringement of Yahoo patents.

We contacted Facebook for a response this afternoon, and haven't heard back yet. UPDATE: Facebook has just replied to our inquiry, with this statement: "We remain perplexed by Yahoo's erratic actions. We disagree with these latest claims and we will continue to defend ourselves vigorously."

Listing image by Photograph by Stephen Chamberlain