SAN FRANCISCO (AP) - A federal appeals court ruled Monday that former Harvard University schoolmates of Facebook founder Mark Zuckerberg can’t undo their settlement over creation of the social networking site.

The 9th U.S. Circuit Court of Appeals said Monday that Tyler and Cameron Winklevoss were savvy enough to understand what they were agreeing to when they signed the agreement in 2008. The deal called for a $20 million cash payment and a partial ownership of Facebook. A third classmate, Divya Narendra, was part of the settlement with the twins but did not pursue the second lawsuit seeking to undo the agreement.

Monday’s ruling upholds a lower court decision enforcing the settlement during the six years of litigation that grew so contentious that the dispute was dramatized in the Oscar-nominated film, “The Social Network.”

The settlement is now worth more than $160 million because of Facebook’s increased valuation.

The twins had alleged they were misled about Facebook’s value when they agreed to settle their lawsuit that claimed Zuckerberg stole their idea to launch Facebook.

“At some point, litigation must come to an end,” chief justice Alex Kozinksi wrote for the unanimous three-judge panel “That point has now been reached.”

The twins alleged they were misled into believing the company was worth $35.90 a share because of an investment by Microsoft Corp. But they argued that the company later valued the company at $8.88 for tax purposes. The twins argue they would have demanded more stock in the company based on the lower valuation.

Kozinski said the twins were “sophisticated parties” when they agreed to the settlement during a mediation meeting.

“They brought half-a-dozen lawyers to the mediation,” Kozinksi wrote.

Facebook said Monday it was pleased by the ruling. Lawyers for the Winklevoss twins said they are reviewing the decision and have not decided on their next step. The twins could ask the Supreme Court to consider the case.