In March, Yahoo accused Mark Zuckerberg's firm of infringing ten of its patents covering advertising, privacy controls and social networking.
After Facebook publicly questioned the "puzzling actions" of Yahoo, the social network has now officially counter-sued. It claims that web portal Yahoo violates its own patented technology covering photo tagging, online recommendations and advertising.
Yahoo has said that Facebook's suit is "without merit", but the rival is thought to be in a much stronger position after recently acquiring 750 patents from technology giant IBM.
At the end of 2011, Facebook had just 56 patents, but it is now much closer to Yahoo's total of around 1,000 patents.
Facebook had also previously purchased some key patents in social networking from Friendster, an early pioneer in the industry.
In its lawsuit, Facebook says Yahoo has particularly infringed its "core" patents for the system for personalising online advertising, which accounts for a large proportion of Yahoo's revenue.
Facebook's general counsel said that the legal action is also in response to Yahoo's decision to "attack" one of its partners.
"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 prioritise litigation over innovation," Ted Ullyot said in a statement.
Commentators have observed that these disputes are often settled by the parties agreeing to licence the patents to each other.
However, the timing of Yahoo's lawsuit, ahead of Facebook's long-awaited initial public offering, was viewed as the firm positioning itself to request a stake in the social network.
Yahoo previously brought a similar patent claim against Google in the run-up to the US firm's initial public offering in 2004, helping it secure 2.7m shares worth $230m (£150m) when the search giant went public.
Last month, Yahoo defended the Facebook lawsuit, saying: "Yahoo has invested substantial resources in research and development through the years, which has resulted in numerous patented inventions of technology that other companies have licensed.
"These technologies are the foundation of our business that engages over 700 million monthly unique visitors, and represent the spirit of innovation upon which Yahoo is built.
"Unfortunately, the matter with Facebook remains unresolved and we are compelled to seek redress in federal court. We are confident that we will prevail."
Neither company's services or operations are expected to be hit by the dispute.
> Facebook, Apple facing class action lawsuit