Facebook is friending the feds.

The company has put political veterans in key executive roles and board positions. It’s also quickly built up a powerhouse Washington lobbying operation and established a political action committee to make it easy for employees to donate to candidates.

It will need those relationships, experts say, as it tries to ward off regulations and investigations over its privacy practices — which are among the greatest risks to its unbridled growth, the company revealed this week in a federal filing for its planned stock offering.

“They are going all out to hire people who are well-connected and buying the Rolodexes that these people bring from the government,” said Steve Stesney, a product manager at First Street, a software company that provides analysis on politics and lobbying. He said Facebook is moving more aggressively than other big Silicon Valley companies to embrace corporate America’s traditional approach to Washington.

Facebook has studied mistakes by older rivals, such as Google and Microsoft, and is responding quickly, experts say, by strategically hiring experienced Democratic and Republican operatives. The company has brought on key operatives from the past three administrations.

Last year it hired Marne Levine, who was chief of staff to Obama’s former chief economic adviser Larry Summers, as head of global public policy in Washington. General counsel Theodore Ullyot was deputy assistant to President George W. Bush. Joe Lockhart, Facebook’s vice president of communications, was President Bill Clinton’s press secretary.

And the most crucial person to Facebook after co-founder and chief executive Mark Zuckerberg is political veteran Sheryl Sandberg, its chief operating officer, the company said in its filing. Sandberg, who was Summers’s chief of staff when he served as Treasury secretary in the Clinton administration, has increasingly become the “grown-up” face for Facebook, experts say, representing the company at high-powered government and business meetings, such as the World Economic Forum at Davos.

With 845 million users and plans to expand overseas, Facebook said it needs to have experienced political staff to defend itself in front of numerous regulators around the world.

“It’s imperative that we scale our policy team so that we have the resources in place to demonstrate to policymakers that we are industry leaders in Internet privacy, security and safety,” Facebook said in a statement.

Its battles are stacking up — from privacy investigations to pushes for new copyright laws.

The company recently agreed to a settlement with the Federal Trade Commission over violating consumer-protection laws, which comes with hefty fines for future violations. That scrutiny and investigations by Irish and German regulators have prompted the company to hire public policy staff members across Europe and in India and Australia.

“There’s a tipping point for tech firms when they go from small to so big that Washington starts to focus on them,” said Bill Allison, editorial director at the Sunlight Foundation, a group that advocates for greater transparency in politics. “That’s what we saw with Microsoft, with Google, to some extent with Apple and now with Facebook, and they are responding by lobbying up.”

Facebook has quickly built up its Washington office, which opened in 2009 with a couple of people, to an estimated 22 registered lobbyists and additional policy experts. It’s brought on more staff members from the White House and key committees in Congress. It recently hired Chris Herndon, who was the senior Republican counsel to the Senate Committee on Commerce, Science, and Transporation — the body that oversees the Internet industry.