Editor's Note: (Julian Zelizer, a CNN political analyst, is a professor of history and public affairs at Princeton University and author of the forthcoming book, "Burning Down the House: Newt Gingrich, the Fall of a Speaker, and the Rise of the New Republican Party." Follow him on Twitter: @julianzelizer. The views expressed in this commentary are his own. View more opinion at CNN.)

(CNN) As the Democratic caucuses and primaries heat up, the candidates are starting to go after each other with greater ferocity. Sensing a potential victory in Iowa, Mayor Pete Buttigieg launched an ad that goes after proposals from Sens. Elizabeth Warren and Bernie Sanders to make tuition free at public colleges and universities.

"I believe we should move to make college affordable for everybody," Buttigieg says in the ad. "There are some voices saying, 'Well that doesn't count unless you go even further, unless it's free even for the kids of millionaires. But I only want to make promises that we can keep."

The mayor's critics have pounced on this line of attack. After all, some of the nation's most successful federal programs — such as Social Security, Medicare and K-12 public education — have been available to all Americans regardless of their income. Surely, he doesn't think that these programs are also misconceived?

New York Rep. Alexandria Ocasio Cortez weighed in with a warning on Twitter: "This is a GOP talking point used to dismantle public systems & it's sad to see a Dem candidate adopt it. Just like rich kids can attend public school, they should be able to attend tuition free public college."

To be sure, it is more than legitimate for Democrats to attack proposals from their competitors as too bold or poorly conceived. It is healthy for Democrats to encounter tough criticism from every quarter to see who is best prepared to take on President Donald Trump in 2020.

But Democrats need to be cautious. There is a long history of Republican candidates using smears that unfairly characterize candidates or their policies against the Democratic party nominee. Very often the candidates who think of themselves as the most moderate in the bunch find themselves the target of rhetoric that they or one of their colleagues originally produced.

Democratic candidates who seek to paint themselves as the most moderate in the pack should not forget just how far the GOP is willing go to paint any of the nominees as wild-eyed socialist radicals. Democrats should not underestimate the importance of working as a party to frame the debate around key issues so that they don't end up giving bipartisan legitimacy to spurious conservative talking points.

During the height of the Cold War in the 1940s and 1950s, Democrats often went after each other by accusing others of being soft on communism. Prominent officials in the party castigated the left wing by charging that they were too radical. In doing so, they played into the strategy of equating domestic progressivism and international diplomacy with socialism. Former Vice President Henry Wallace was one of the prime victims of this kind of campaign.

Yet Democrats — from Presidents Harry Truman to Lyndon Johnson — learned that they could not contain the fallout from this style of partisan warfare. Eventually, no matter how hawkish the Democrats were, Republicans went after them as being part of the party that was too weak on defense.

When former Democratic Vice President Hubert Humphrey made a bid for the presidential nomination in 1972, he condemned South Dakota Sen. George McGovern for being weak on defense. Humphrey warned: "Nor am I going to let Senator McGovern's defense proposals make America into second‐class power."

McGovern won the nomination. President Richard Nixon put together a fierce campaign that tagged McGovern as a leftist who would endanger national security. Although McGovern had been a staunch internationalist who supported most of the Cold War strategy, Nixon was successful.

In 1984, Democrats were desperate to figure out who was the most electable Democrat to defeat President Ronald Reagan, who in their mind had brought the country into a dangerous era of conservatism, threatening global peace and the social safety net. Ohio Sen. John Glenn, who believed that he had the best chance to beat the Gipper, warned voters that Minnesota Sen. Walter Mondale had supported dangerous cuts in defense spending that jeopardized key programs like the Navy's F-14 Tomcat fighter plane program.

After Mondale won the nomination, Reagan frequently turned to quotes from Democrats that depicted Mondale as coming from the dovish wing of the party, which he was not.

In 1988, during the Massachusetts primary, Al Gore brought up the state's weekend furlough program for prisoners. He did so to tag the state's technocratic Gov. Michael Dukakis as being far too liberal on crime, a big topic in the 1980s (though the furlough program was started by Dukakis' predecessor).

Republicans remembered what Gore had said when then-Vice President George H.W. Bush faced off against Dukakis in the general election. The GOP injected race into the story by highlighting the case of an African-American man named Willie Horton, who had escaped from the furlough program, raped a white woman and stabbed her partner. The Republican campaign effectively devastated Dukakis's image by summoning the case.

Similarly, in 2004 Massachusetts Sen. John Kerry went after Vermont Gov. Howard Dean, who had been doing well in the race, speaking about his opposition to the disastrous war in Iraq. Kerry warned that Dean would be weak on defense after 9/11 and that his candidacy would ensure President George W. Bush's re-election.

Referring to Dean's statement that the US was not safer after Saddam Hussein had been captured, Kerry said: "Someone who talks like this is going to have a hard time convincing the American people that he can keep them safe. This election is too vital for us to lose ... because voters refuse to take a gamble on national security and the steadiness of our leadership." Although Kerry won the nomination, that became the centerpiece of GOP attacks against him.

Democrats who attack from the center don't always think through the potential impact of their words. They operate from a mythical position that they will be able to insulate themselves from the same such attacks if their turn comes in the crossfire. But we have seen from history it doesn't work that way.

The better strategy would be to shore up support for Democratic ideas and policies during the caucuses and primaries, insisting on a debate that centers on those terms rather than Republican points, and not offering the GOP more material going into the fall campaign.

For if they are not careful, the moderates might end up doing exactly what Republicans are hoping for, thereby helping to set up the conditions for President Trump's reelection.

Correction: An earlier version of this column gave an incorrect position for Henry Wallace.