It was just before the New Hampshire primary in February. Jeb Bush, once the heir apparent in a sprawling Republican field, was mired in fifth place. In debate after debate, he had been outmaneuvered and humiliated by Donald Trump, whose reality-show instincts and merciless insults had turned the GOP primaries into a demolition derby. But unlike his rivals, Bush had a campaign war chest big enough to pick off anyone who stood in his path. So he did what candidates have always done when they’re plunging in the polls: He flooded the airwaves with attack ads.

In the fiercest ad of the primary season, the Bush campaign set out to expose Trump as an unhinged bully. For two full minutes, the commercial cycles through clips of Trump spewing outlandish insults at John McCain, Carly Fiorina, and a disabled New York Times reporter. “I could stand in the middle of Fifth Avenue and shoot somebody,” Trump brags, “and I wouldn’t lose any voters, OK?” The ad was a classic example of campaign mudslinging, following the tried-and-true script of smearing an opponent with his own words.

Except for one thing: It didn’t work.

The ad aired for seven straight days before voters went to the polls in New Hampshire. Before it started, Trump was sitting at 33 percent. The day it ended, he won the state with 35 percent of the vote. And among voters who made up their minds during the week the ad aired, more broke for Trump than for Bush.

For the past year, the New Republic has tracked every political ad released by presidential candidates and their super PACs. Of the 325 Republican commercials in our online archive, 141 were attack ads—and Trump was the target of nearly half of them. His GOP rivals spent $75 million to assail him on everything from his Mafia connections to shady business deals to flagrant misogyny and racism.

But according to our analysis, the brutal ad blitzes not only failed to dent Trump, they often made him stronger, shoring up his base and sending him surging in the polls. “People who support Trump could care less how many people attack him,” says Shanto Iyengar, a political science professor at Stanford University and the co-author of Going Negative, a seminal book about political advertising. “To be attacked by the elites, it is a red badge of courage. It makes people more enthusiastic about him.”

The same scenario played out again and again throughout the primary season. South Carolina, deep in the Bible Belt, ought to have been Ted Cruz territory. Ten days before the Republican primary, the Cruz campaign rolled out a series of ads that aimed to expose Trump as a grasping developer and crooked power broker. One spot chronicled how Trump used eminent domain to force an elderly widow from her modest Atlantic City home to make way for a parking lot to accommodate the sleek limousines visiting the Trump Plaza Hotel and Casino. “Trump bankrolled politicians to steamroll the little guy,” the narrator says. “A pattern of sleaze stretching back decades.”

Rather than rise in the polls, however, Cruz dropped from 21 percent to 17 percent immediately after he began airing the attack ads. He eventually finished third, eclipsed by Marco Rubio. Trump held relatively steady, even as the attacks intensified, winning the state handily with 33 percent.

After South Carolina, Rubio stepped into the fray. In the week after he walloped Trump at the Republican debate in Houston, Rubio’s super PAC, Conservative Solutions, raised $20 million for an assault on the front-runner. A dark-money group called the American Future Fund rolled out three ads featuring middle-class Americans who had spent $35,000 to enroll in Trump University courses that turned out, they said, to be a scam. “America, do not make the same mistake I did with Donald Trump,” a single mom named Sherri pleads in one ad, her voice wavering. “I got hurt badly.”

As the attacks escalated through early March, however, Trump climbed ten points and finished with 46 percent. All told, outside groups and super PACs ran more than 4,300 commercial spots hammering Trump in Florida—more than twice the number Trump funded to defend himself—only to see him rise in the polls.

“We’ve never seen anything like him,” says Jim Duffy, a media strategist at the Democratic consulting ​firm Putnam Partners. “He defies every rule of thumb in politics.”

It’s impossible, of course, to view any single campaign ad in complete isolation; a host of factors contribute to a candidate’s electoral results. But attack ads have long been one of the most effective weapons in American political campaigns. According to political scientists, campaign ads matter most in two situations: when voters know very little about a candidate, or when one candidate is able to dramatically outspend another. “The general agreement was that the candidate who had a real firepower advantage, who could outspend their opponents, would stand to benefit,” Iyengar says. The math was simple: More money meant more ads, and more ads meant more votes. In 2012, for example, Mitt Romney accrued a massive financial advantage going into the primaries and was able to use attack ads to pick off his rivals one after another.

Now, as the focus shifts from the primaries to the general election, Hillary Clinton appears to be playing by the same playbook used by Trump’s rivals. Less than a day after Cruz bowed out of the Republican race in May, clearing the way for Trump to clinch the GOP nomination, Clinton’s campaign released a short video on Twitter.

“He is a con artist,” Rubio begins.

“A phony,” Romney says.

“Donald is a bully,” Cruz adds.

“This is an individual who mocked a disabled reporter,” Romney says.

“The most vulgar person ever to aspire to the presidency,” Rubio says.

“He needs therapy,” Bush sighs in disgust.

It’s possible that such broadsides by Trump’s vanquished rivals may hurt him more in the general election than they did in the GOP primary. That’s certainly what strategists at Priorities USA Action believe. Priorities USA, a super PAC founded by two White House veterans to combat the flood of cash pouring into Republican coffers after the Supreme Court’s decision in Citizens United, plans to serve as Clinton’s main attack dog this fall. For months, the group has been reserving prime airtime in battleground states and assembling dossiers of damning research on Trump. According to Justin Barasky, the communications director at Priorities USA, Trump’s GOP opponents effectively served as Clinton’s guinea pigs. “They saved us millions of dollars, because we could focus group their ads,” he says. “Some of these lines of attack are very effective against him in the broader electorate.”

But those who went after Trump and failed warn that Clinton should think twice before relying on attack ads. “For the last year, I have heard people saying that about Donald Trump,” says Fred Davis, a veteran Republican consultant who created multiple TV ads attacking Trump for New Day for America, the super PAC that backed John Kasich. “But he swamped Jeb Bush and Chris Christie and Marco Rubio and Scott Walker—all these people who were supposed to make mincemeat out of him.”

To take down a candidate who has defied every rule of thumb in politics, Clinton may need to throw out the old playbook and start coming up with new strategies. Like Jeb Bush, she entered the race as her party’s heir apparent—and Trump does best when he’s being attacked by a political insider like Clinton.

“They better change their tactics,” Davis says. “How many charges are left that people haven’t heard? They have already heard about the school and the businesses that failed. His popularity is increasing—not decreasing—with these attacks.”