It’s awfully early for John McCain to be running such a desperate, ugly campaign against Barack Obama. But I guess it’s useful for Democrats to get a reminder that the Republican Party plays presidential politics by the same moral code that guided the bad-boy Oakland Raiders in their heyday: “Just win, baby.”

The latest bit of snarling, mean-spirited nonsense to come out of the McCain camp was the accusation, leveled by campaign manager Rick Davis, that Obama had “played the race card.” He did so, apparently, by being black.

On Wednesday, at a campaign stop in Missouri, Obama had predicted that Republicans would try to “make you scared of me. You know, ‘he’s not patriotic enough, he’s got a funny name,’ you know, ‘he doesn’t look like all those other presidents on the dollar bills.’ ” So what does Davis do? He promptly tries to make voters scared of Obama by feigning outrage over the presumptive Democratic nominee’s “divisive, negative, shameful and wrong” remarks.

Of course the McCain campaign isn’t really offended that the first black major-party candidate for president in American history might mention this distinction from time to time. The idea is to slow Obama down before he runs away with this thing, and the weapon of choice is handfuls of mud.

Remember St. John the Reformer, who promised a high-minded campaign and said he wouldn’t question his opponent’s patriotism? Clearly, he’s been replaced by an evil twin. The switch seems to have taken place during his opponent’s world tour, when Obama’s prescriptions for Iraq and Afghanistan began to look prescient — and McCain’s began to look irrelevant.

McCain kept saying that Obama “doesn’t understand” the war zones — even though the president of Afghanistan, the prime minister of Iraq and even U.S. military officials on the ground seemed to think Obama understood both situations quite well. McCain then resorted to the outrageous charge that Obama “would rather lose a war in order to win a political campaign.” I think that qualifies as an allegation that Obama is “not patriotic enough,” don’t you?

Since then, the McCain campaign has sharply escalated its rhetorical attacks — making blatantly false claims, for example, about a canceled visit with injured troops in Germany. The blitz has been successful in one of its aims, which is to drive the news cycle and thus focus attention on McCain. Much less clear is whether voters really want to elect Don Rickles as president.

The low point, so far, is McCain’s bizarre ad that flashes images of Paris Hilton and Britney Spears before showing Obama in Berlin addressing the multitudes. In what promises to be a major attack theme, the ad derides Obama as “the biggest celebrity in the world” — an attempt to turn Obama’s popularity into some kind of fatal flaw.

In a conference call with reporters Wednesday, Davis and campaign senior adviser Steve Schmidt — a veteran of George W. Bush’s 2004 campaign — kept returning to the word celebrity in describing Obama. It’s a classic attempt to take a positive and turn it into a negative, as was done with John Kerry’s heroic service in Vietnam by the odious Swift boat campaign.

The McCain campaign’s excursion into popular culture has been so aggressive that the Obama campaign felt obliged to promptly denounce a new song by Ludacris that criticizes both McCain and Hillary Clinton in crude terms. Never mind that the rapper has no association with Obama’s candidacy, and never mind that McCain is probably not intimately familiar with the Ludacris oeuvre. All this gnashing and flailing would be laughable if it weren’t so purposeful. The aim is to cast an aura of doubt around Obama — to portray him as handsome and popular but insubstantial, as a “celebrity” who’s not really up to the job. Oh, and not that we would ever mention such a thing, but did you notice that Obama had the audacity to mention that he’s African-American?

The Obama campaign has been quick to respond with new television ads accusing McCain of practicing the “old politics.” Kerry’s unhappy experience showed that this kind of define-your-opponent blitzkrieg, however ridiculous the attacks may be, has to be answered immediately — and in kind.

Negative campaigning is not a pretty thing, and it should be beneath John McCain to stoop so low. But Democrats would be foolish to forget that sometimes it works.

Eugene Robinson’s e-mail address is eugenerobinson(at)washpost.com.