Facebook is close to putting an uncomfortable and embarrassing legal episode behind it.

INSERT DESCRIPTIONConnectU founders Tyler Winklevoss, left, and Cameron Winklevoss, right, and Divya Narendra. (Photo: Charles Krupa/Associated Press)

A person briefed on the status of dueling lawsuits between Facebook and the competing site ConnectU said on Sunday that Facebook was finalizing a settlement with the founders of ConnectU — brothers Cameron and Tyler Winklevoss and their colleague, Divya Narendra.

The ConnectU founders were accusing Mark Zuckerberg and the original crew behind Facebook of pilfering their profitable idea back in 2003, when they were all Harvard students. Facebook had filed a countersuit, accusing ConnectU of unfair business practices.

Terms of the settlement were not disclosed. In the meantime, all motions in the case against ConnectU have been terminated.

ConnectU did not immediately respond to an e-mail message requesting comment. A California federal judge had ordered the parties into mediation last year.

The ConnectU founders asserted that they hired Mr. Zuckerberg, then a sophomore at Harvard, in 2003 to help create a campus-wide dating site called Harvard Connection. They say that he stalled on the project for months while nurturing his own idea and ultimately starting TheFacebook.com. The case cast doubts on Mr. Zuckerberg’s ingenuity, and discovery efforts turned up some embarrassing material — like his diary. Facebook clearly needed to make the suit go away before a widely expected initial public offering that could come as early as next year.

A Facebook spokeswoman said the company would not comment on legal matters. But the person briefed on the status of the negotiations said motions to dismiss the cases were expected to be filed “within weeks.”