For the past few days, a mystery has been unfolding in Silicon Valley. Somebody, it seems, hired Burson-Marsteller, a top public-relations firm, to pitch anti-Google stories to newspapers, urging them to investigate claims that Google was invading people’s privacy. Burson even offered to help an influential blogger write a Google-bashing op-ed, which it promised it could place in outlets like The Washington Post, Politico, and The Huffington Post.

The plot backfired when the blogger turned down Burson’s offer and posted the emails that Burson had sent him. It got worse when USA Today broke a story accusing Burson of spreading a “whisper campaign” about Google “on behalf of an unnamed client.”

But who was the mysterious unnamed client? While fingers pointed at Apple and Microsoft, The Daily Beast discovered that it's a company nobody suspected—Facebook.

Confronted with evidence, a Facebook spokesman last night confirmed that Facebook hired Burson, citing two reasons: first, it believes Google is doing some things in social networking that raise privacy concerns; second, and perhaps more important, Facebook resents Google’s attempts to use Facebook data in its own social-networking service.

Like a Cold War spy case made public, the PR fiasco reveals—and ratchets up—the growing rivalry between Google and Facebook. Google, the search giant, views Facebook as a threat, and has been determined to fight back by launching a social-networking system of its own. So far, however, Google has not had much luck, but Facebook nonetheless felt it necessary to return fire—clandestinely.

Here were two guys from one of the biggest PR agencies in the world, blustering around Silicon Valley like a pair of Keystone Kops.

At issue in this latest skirmish is a Google tool called Social Circle, which lets people with Gmail accounts see information not only about their friends but also about the friends of their friends, which Google calls “secondary connections.” Burson, in its pitch to journalists, claimed Social Circle was “designed to scrape private data and build deeply personal dossiers on millions of users—in a direct and flagrant violation of [Google's] agreement with the FTC.”

Also from Burson: “The American people must be made aware of the now immediate intrusions into their deeply personal lives Google is cataloging and broadcasting every minute of every day—without their permission.”

Chris Soghoian, a blogger Burson offered to help write an op-ed, says Burson was “making a mountain out of molehill,” and that Social Circle isn’t dangerous.

Soghoian asked Burson directly what company was paying the agency to spread this stuff around. Burson wouldn’t say. Miffed, Soghoian published their email exchange online. You can see it here.

The story gained wider attention when USA Today reported that two PR flacks from Burson—former CNBC tech reporter Jim Goldman, and John Mercurio, a former political reporter—had been pushing reporters at USA Today and other outlets to write stories and editorials claiming Google was violating people’s privacy with Social Circle.

USA Today looked into it, but decided the claims were exaggerated—at which point, Goldman ran for cover. “After Goldman’s pitch proved largely untrue, he subsequently declined USA Today’s requests for comments,” the paper reported.

The mess, seemingly worthy of a Nixon reelection campaign, is embarrassing for Facebook, which has struggled at times to brand itself as trustworthy. But even more so for Burson-Marsteller, a huge PR firm that has represented lots of blue-chip corporate clients in its 58-year history. Mark Penn, Burson’s CEO, has been a political consultant for Bill Clinton, and is best known as the chief strategist in HIllary Clinton’s 2008 presidential campaign.

Yet here were two guys from one of the biggest and best-known PR agencies in the world, blustering around Silicon Valley like a pair of Keystone Kops. Even yesterday, when I asked flat out whether Facebook had been the client behind the campaign, a Burson spokesman refused to confirm it. Then, later, learning that Facebook had come clean, the Burson spokesman wrote back and confirmed it.

As for Facebook, its pious handwringing about user privacy might be a bit of a smokescreen. What really seems to be angering Facebook is that some of the stuff that pops up under “secondary connections” in Google’s Social Circle is content pulled from Facebook.

In other words, just as Google built Google News by taking content created by hundreds of newspapers and repackaging it, so now Google aims to build a social-networking business by using that rich user data that Facebook has gathered.

Facebook claims that Google is violating Facebook’s terms of service when it uses Facebook member data in that way. “We are concerned that Google may be improperly using data they have scraped about Facebook users,” the spokesman says. A Google spokeswoman reached last night said Facebook’s allegation about Google improperly using data was a new one and the company needed time to consider a response.

The clash between Google and Facebook represents one of the biggest battles of the Internet Age. Basically, the companies are vying to see who will grab the lion’s share of online advertising.

Facebook has 600 million members and gathers information on who those people are, who their friends are, and what they like. That data let Facebook sell targeted advertising. It also makes Facebook a huge rival to Google.

Last month, Google CEO and cofounder Larry Page sent out a memo telling everyone at Google that social networking was a top priority for Google—so much so that 25 percent of every Googler’s bonus this year will be based on how well Google does in social.

It’s hard to say whether Google will ever be able to crack Facebook’s grip on social networking. But after this sorry, clumsy episode, Facebook no longer seems so invincible. In fact, it almost seems a little afraid.

Dan Lyons is technology editor at Newsweek and the creator of Fake Steve Jobs, the persona behind the notorious tech blog, The Secret Diary of Steve Jobs. Before joining Newsweek, Lyons spent 10 years at Forbes.