Yahoo (Nasdaq: YHOO), the No. 3 search engine, could settle its patent dispute with Facebook (Nasdaq: FB), the No. 1 social networking site, soon, its lawyer told a federal judge in San Francisco Wednesday.

The parties are engaged in settlement negotiations to resolve this dispute, Yahoo's lawyer, Kevin Smith, wrote in a filing seeking to delay an Aug. 10 hearing.

Under former CEO Scott Thompson, the Sunnyvale, Calif.-based search engine sued Facebook in March, before its $16 billion initial public offering, alleging infringement of its many Internet patents. Facebook, of Menlo Park, Calif., denied the claims.

Then Facebook counterclaimed that Yahoo had abused 10 of its patents. Yahoo replaced Thompson last month with interim CEO Ross Levinsohn.

A settlement had been expected because of a precedent: Before Google (Nasdaq: GOOG) went public in 2004, it settled similar patent claims with Yahoo for which it received about $230 million in shares.

Yahoo shares rose a nickel to $15.70 near Wednesday's close while Facebook shares fell 27 cents to $31.65.