Bernie Sanders lost the Democratic primary to Hillary Clinton by well over 3 million votes and hundreds of pledged delegates to the Democratic convention. But the upstart Senator from Vermont gave Hillary Clinton’s campaign a shock during the heady peak of his campaign in early February, when he beat her in a landslide victory in New Hampshire.

Much of Sanders’ success in New Hampshire and beyond, says his senior advisor Tad Devine, can be attributed to his advertising team.

Speaking in a Washington hotel, Devine, an advertising guru and veteran strategist with experience on dozens of campaigns, laid out his ad strategy throughout the course of Sanders’ 2015-2016 primary campaign. Devine’s firm produced the majority of the campaign’s advertising.

“For us, the paid media campaign was essential, I believe, for establishing Bernie Sanders as a credible, serious candidate for president against a well-known, well-liked frontrunner,” Devine told attendees the AdAge and Time Inc.-hosted Campaign 2016 Summit on Wednesday, a day after Sanders lost the last primary in Washington D.C. “We were able to establish Bernie through a series of ads.” (Time Inc. is the parent company of TIME magazine.)

The Sanders campaign outspent Clinton’s campaign in advertising spending, pouring around $74 million into television ad spots in the primary states by mid May, according to a study by the Wesleyan Media Project, compared with $63 million in spending by Clinton and her allies. (The two campaigns spent about equally in both Iowa and New Hampshire.)

Some of Sanders’ campaign staff, particularly field organizers, have told TIME they were deeply unhappy with the level of advertising spending directed by the top tiers of the campaign and wanted more to spent on direct voter contacts like canvassing and phone banking. The Washington Post reported that Devine’s firm was among three consulting firms that earned payments of seven figures by May.

Some critics on the campaign said that Sanders had become widely popular before the advertising blitz began. By late October, Sanders was at 34% in Iowa polls compared with 51% for Clinton, according to a Huffington Post average, and was already leading Clinton in New Hampshire.

Devine insisted that much of Sanders’ success was due to paid media, explaining that it helped boost his profile from a virtual unknown nationwide into a popular figure. Sanders barely registered in state polls before early 2016; he went on to win New Hampshire in a landslide and bring Clinton to a virtual draw in Iowa. Indeed, Sanders performed best by the time voting began and after several months of advertising.

Devine said that he and other top aides planned out ads in Iowa and New Hampshire five stages, explained below:

The campaign began putting ads on the air in November with biographical ads, Devine said, in which the campaign introduced Sanders to voters in the early states with a series of ads explaining Sanders’ history in Brooklyn and attending the March on Washington in 1963. “Now he’s taking on Wall Street and a corrupt political system,” says a narrator in one of the ads.

In the second phase of advertising, Devine said, the campaign laid out Sanders’ core campaign message: that he was fighting against income inequality, the political establishment and political corruption. One of the ads, called “Rigged Economy,” told voters just that. “Bernie Sanders: husband, father, grandfather. He’s taking on Wall Street and a corrupt political system that keeps in place a rigged economy,” says a narrator.

The campaign then moved to a series of testimonial and issue-specific ads on topics ranging from free public college to single-payer healthcare.

Devine said that the campaign also played an advertisement about Sanders’ congressional record. “We also heavily rotated an ad about Bernie’s effectiveness, which was a concern of many voters we found in our research, particularly in Iowa and also to an extent in New Hampshire,” Devine said.

Devine said that the campaign then moved to advertisements about the role of Wall Street and politicians who receive speaking fees. The Clinton campaign aides cried foul, believing these ads were implicitly targeted at Hillary Clinton and broke Sanders’ promise never to run a negative campaign. The one called “Two Visions” had Sanders speaking to camera explaining that there are “two Democratic visions for regulating Wall Street: one says its okay to take millions from big banks and then tell them what to do.”

Then came the advertisement that was widely considered the tour de force of the Sanders campaign ads, “America.” It was released a little over a week before the Iowa caucus and simply included images of a wide array of people from all around the country, with the sound of Simon & Garfunkel’s “America.” The song was played over and over again at rallies; the ad came to reflect what many Sanders supporters saw was best in the campaign.

“In my mind the America ad, was if you’ve got great relief pitching, you’ve got a starter that was seven innings, somebody comes in in the eighth and they get three outs, okay?” Devine said. “In my mind the America ad was the eighth inning pitcher who set it up. Every time you put it up you get three outs.”

“It was a positive look at both he campaign and what the campaign represented and the future,” he added.

Contact us at letters@time.com.