With social network giant Facebook officially gearing up for its initial public offering, the company’s top executives and largest investors are poised for a historic windfall. But far from Silicon Valley or Wall Street, there is another group of folks positioned to prosper from what is expected to be the biggest tech IPO ever — Democratic and Republican candidates for office.

Many of those about to strike it rich (OK, richer) with Facebook are some of the heaviest hitting political donors in the country. Facebook CEO Mark Zuckerberg is not an active donor himself, but he has long maintained a positive and public relationship with President Obama. Along with a handful of other tech CEOs , Zuckerberg, whose worth could increase by up to $28 billion in the IPO, feted Obama at a February dinner last year that was implicitly, if not overtly, political in nature. He also hosted a townhall with the President at Facebook’s sparkling Palo Alto headquarters two months later. And his company has become increasingly involved in politics. Its political action committee reported raising $170,000 in the final three months of 2011, mostly from its employees, who are among some of the most politically active in Silicon Valley.

In 2011, David Fischer, the Vice President of Advertising and Global Operations at Facebook, and COO Sheryl Sandberg both gave the maximum donation to the Democratic party ($30,800) and Obama’s re-election campaign ($2,500). Sandberg, a former adviser to Larry Summers in the Clinton Administration who has a $100-million stake in her company, also maxed out with House majority leader Nancy Pelosi, Minnesota Senator Amy Klobuchar, New York’s Kirsten Gillibrand and Missouri’s Claire McCaskill. But it’s not all Democratic gifts at Facebook–Vice President and General Counsel Theodore Ullyot gave the max to House Speaker John Boehner and Alex Bain, who manages the company’s mobile analytics division, cut a $2,500 check for Mitt Romney.

IPO largesse for big political donors isn’t limited to Facebook either. LinkedIn CEO Jeff Weiner, also of Accell Partners, a venture capital firm that invested $12.7 million in Facebook in 2005 that could see its stock become worth as much as $11.4 billion, donated the maximum $30,800 to the DNC in 2011. Another Accell partner, Jim Swartz, gave the maximum individual contribution to Jon Huntsman’s presidential campaign and Scott Brown’s Massachusetts Senate re-election bid last year.

Roger McNamee, co-founder of Elevation Partners, the Bono-backed venture capital firm that bought $120 million in Facebook shares in 2010, also gave the max five-figure donation to the Democratic party and four figures to the Obama re-elect. Another founding partner, Bret Pearlman, gave the maximum individual donation to Romney and Josh Mandel, Ohio’s state treasurer who is expected to challenge Democratic Senator Sherrod Brown this year. Web pioneer and Netscape founder-turned-investor Marc Andreessen, who owns 3.6 million shares in Facebook, gave $30,800 to the National Republican Senatorial Committee in 2011, as well as big donations to the campaigns of Romney and Utah Senator Orrin Hatch, and $50,000 to the pro-Romney super PAC Restore Our Future.

But even those donations are dwarfed by those from venture capitalist, PayPal founder and early Facebook investor Peter Thiel, who currently holds 2.5% of Facebook’s stock worth as much as $2.5 billion. Thiel was one of single-largest political contributors in the country this election cycle: he gave $900,000 to pro-Ron Paul super PAC Endorse Liberty in 2011, as well as $10,000 to the Republican Party of Cuyahoga County in Ohio and maximum individual donations to Mandel, Ted Cruz, a Senate candidate in Texas, and Randy Altschuler, who’s running for Congress in New York’s 1st District.

Update: Buzzfeed’s Ben Smith reports on several more Obama donors who stand to gain big from Facebook’s IPO: Sean Parker, the company’s former president who holds 4% of the shares, maxed out to the DNC last year; so did Reid Hoffman, the co-founder of LinkedIn, who own $400 million+ in Facebook stock; and ex-Obama campaign staffer Chris Hughes holds a 1% stake.