Yahoo Inc. (Nasdaq: YHOO) has threatened legal action against Facebook Inc. if the Internet company and the social-networking giant can't agree on licensing technologies covered by patents that Yahoo holds and on which it accuses Facebook of infringing, the New York Times reported Tuesday.

Yahoo is seeking to force Facebook into licensing 10 to 20 patents over technologies for technologies that involve advertising, website customization, social networking and messaging, the Times' DealBook blog quoted people briefed on the matter as saying. 

The two Silicon Valley companies dicussed the matter on Monday, the sources told the Times. Yahoo is asking Facebook to pay licensing fees or risk a civil lawsuit.

Yahoo has a responsibility to its shareholders, employees and other stakeholders to protect its intellectual property, Yahoo spokesman told the Times in an e-mailed statement. We must insist that Facebook either enter into a licensing agreement or we will be compelled to move forward unilaterally to protect our rights.

A spokesman for Facebook said in a statement to the Times that the company hadn't had the opportunity to fully evaluate [Yahoo's] claims.

The claim of patent infringement comes at a sensitive time. Facebook has filed a prospectus with U.S. regulators for its initial public offering, through which it seeks to raise $5 billion.

In 2004, Google Inc. (Nasdaq: GOOG) faced a similar situation, months before its IPO. Google gave Yahoo 2.7 million shares of its stock to settle patent-infringement and other legal claims.