Facebook Inc. (Nasdaq: FB) director Peter Thiel sold most of his stake in the operator of the world’s largest social-networking website, bringing his proceeds to more than $1 billion, after restrictions on insider sales ended.

Thiel, one of Facebook’s earliest investors, sold about 20.1 million shares in the company on Aug. 16 and Aug. 17, raising $395.8 million, according to a filing Monday with the U.S. Securities and Exchange Commission. Thiel, a venture capitalist and hedge-fund manager, had already generated $640.1 million in sales during the initial public offering.

With an investment of $500,000 in 2004, Thiel is one of the biggest beneficiaries of Facebook’s gain before going public. Later backers haven’t fared as well, with the stock losing almost half its value since the IPO amid signs that the company’s growth is slowing and concerns that more insiders will exit their stakes. The sales disclosed Monday were tied to a plan adopted on May 18, Facebook’s first day of trading.

“As of last May, he had basically handed over discretion about these sales,” said Stephen Diamond, associate professor of law at Santa Clara University.

Jeremiah Hall, a spokesman for Thiel, and Ashley Zandy, a spokeswoman for Facebook, declined to comment.

Facebook last week unlocked 271.1 million shares, the first of five insider-sale restrictions scheduled during the company’s first year as a public company. Another 1.44 billion shares will be freed up through November.

Shares of Menlo Park, California-based Facebook closed at $20.01 Monday.

Still Holds 5M-plus Shares

Another Facebook investor, Accel Partners, distributed more than 50 million shares to investors in the venture capital firm’s funds on Aug. 16, according to another filing yesterday.

Thiel’s sale, at prices from $19.27 to $20.69 a share, represents most of the 27.9 million shares the investor held after the IPO. He still holds more than 5 million shares, and the proceeds don’t reflect underwriter or broker fees.

Thiel freed up extra shares for sale when he converted more than 9 million shares to Class A from Class B, according to a document filed Aug. 10 with the U.S. Securities and Exchange Commission.

As a co-founder of PayPal Inc., he served as chief executive officer until the company was bought by EBay Inc. for $1.5 billion in 2002.

Thiel, who’s also a member of the so- called “PayPal Mafia,” used his fortune to start hedge fund Clarium Capital Management LLC and to invest in startups.

One of those startups was Facebook, a social-networking service devoted to college campuses at the time of the investment in 2004. Thiel also participated in a $25 million funding round in 2006 when the company was valued at $500 million.