Facebook has responded to Yahoo’s recent patent infringement lawsuit by filing a counterclaim of its own in a San Francisco federal court. Facebook claims Yahoo has violated their patents covering photo tagging, advertising and online recommendations.

Last month Yahoo filed a lawsuit against Facebook claiming the social networking giant was infringing ten of their patents including aspects of technologies utilized for web advertising. The firm even went as far as to claim that the company founded by Mark Zuckerberg is based entirely on their social networking model and therefore infringed their rights to innovations in the fields of messaging, privacy controls, advertising, customization and social networking.

Yahoo spokesman Eric Berman speaking to Reuters said Facebook's counterclaim is "nothing more than a cynical attempt to distract from the weakness of its defense."

Their defense consists of five patents which Facebook claims Yahoo is infringing in respect to their online advertising business, which the social networking giant noted is around 80% of Yahoo’s 2011 income in the court filings. Facebook also claim that the Flickr photo sharing service infringes several other patents they own, including the ability to connect with other users of the online service, as well as identifying people in a photo and the ability to create and use news feeds using generated and personalized data.

"While we are asserting patent claims of our own, we do so in response to Yahoo's short-sighted decision to attack one of its partners and prioritize litigation over innovation," said Facebook General Counsel Ted Ullyot.

At least one patent listed shows Mark Zuckerberg as the inventor in the patent records. A couple is also believed to have been acquired with the purchase of 750 patents from IBM towards the end of last month.

Facebook also argues that previous partnerships between the two firms give them the right to use some of their patents. The case in the US District Court of the Northern District of California is Yahoo Inc. v. Facebook Inc., case number 12-cv-1212.