Mark Zuckerberg has prevailed in his battle with a man who claimed to own half of Facebook.

Federal agents today arrested Paul Ceglia, a wood-pellet salesman from upstate New York, for doctoring documents in an attempt to extort money from the social-networking founder.

Ceglia made waves when he sued Zuckerberg in federal court in Buffalo two years ago, saying the CEO signed a contract in 2003 promising Ceglia a 50-percent stake in Facebook.

It turns out that claim was “entirely false,” according to a complaint filed today by Manhattan US Attorney Preet Bharara.

Ceglia, 39, was arrested this morning in his Wellsville, NY, home. He will be presented at the federal courthouse in Buffalo later this afternoon.

Prosecutors found that Ceglia did enter a contract with the 28-year-old Zuckerberg in 2003, when he was still a student at Harvard University. In the contract, Zuckerberg had agreed to perform certain programming work for Ceglia’s online business, StreetFax.com, and Ceglia agreed to pay him a fee for his work.

Ceglia “simply replaced page one of the real contract with a new page one doctored to make it appear as though Zuckerberg had agreed to provide Ceglia with an interest in Facebook,” according to the complaint.

“Ceglia doctored, fabricated and destroyed evidence to support his false claim,” the complaint says.

Prosecutors discovered the truth by searching of one of Ceglia’s hard drives, which uncovered a copy of the real 2003 contract. Ceglia had e-mailed a copy of the real contract to an attorney in March 2004, well before he filed his suit.

That version of the contract “makes no reference to Facebook in any fashion,” the complaint says.