Zach Galifianakis – the co-star with Will Ferrell in the political comedy The Campaign – was a three-year-old in Wilkesboro, N.C., when dirty politics entered his family life.

The subtext: A Greek-American wasn’t really American.

His uncle Nick Galifianakis was a veteran Congressman who chose to run in 1972 for the Senate against the late, merciless Republican Jesse Helms, who ran under the slogan “Jesse Helms. He’s one of us.” “He lost because he was Greek, that’s kind of what happened,” Galifianakis said in a joint interview with Ferrell promoting The Campaign.

The movie – about a well-coiffed gaffe-prone veteran Congressman named Cam Brady (Ferrell) who has run unchallenged for years and finally has to start flinging mud against an odd-but-effective challenger named Marty Huggins (Galifianakis) – opens Friday.

“When my uncle ran, it was the beginning of mud-slinging in modern politics, at least in that state,” Galifianakis says. “I grew up listening to all the stories. The election got turned around in a couple of weeks. The KKK (Ku Klux Klan) made appearances at a couple of rallies, I guess to intimidate him.”

What? The Klan doesn’t like Greeks either? “I think the idea was, ‘His name sounds different enough. He’s not like us.’”

Ferrell’s Carolina connection (his family moved from a town near Raleigh-Durham called Roanoke Rapids) led the two comic collaborators to turn to the Tarheel State as a setting for their broad, cut-throat election comedy.

Ferrell based his own character on North Carolina’s John Edwards, who threw away his career on a blond videographer and a baby he initially refused to admit was his.

“I found him fascinating and read a couple of books on him prior to the movie,” Ferrell says. “Like Cam Brady, Edwards was somebody who probably started out in earnest. And then people in The Machine said, Y’know what? You’re handsome, you speak well. Good things could happen for you. You’re like a Kennedy.’ “Then he lost sight of things and got caught up in all that stuff.”

Originally, the plan was to film a mockumentary, inspired by The War Room, the acclaimed doc about the Clinton election machine. The plan was to make Ferrell’s pseudo John Edwards the focus.

“And Zach was going to be kind of my Svengali, my (James) Carville. It was going to be kind of smaller, with more of an In the Loop type of feel to it,” Ferrell adds, referencing the Oscar-nominated British comedy about American and British government staffers clumsily negotiating the U.K.’s involvement in the Iraq War.

Galifianakis’ character was, and is, a bit of a departure from the misanthropic stoners he’s played in movies such as The Hangover and Due Date.

“There was a character I did in high school called the effeminate racist,” Galifianakis recalls. “I always thought there was something funny about somebody who’d been discriminated against for the way he was, discriminating against other people. So I just sort of kept that character in the back of my mind. And then 20 years later I started doing him again onstage. And Will saw it and said, 'We should try to put that guy in the movie.’"

But high-minded intentions ultimately gave way to a bigger budget and a decision to make a broader comedy – as evidenced by a scene in the trailer wherein Cam Brady accidentally punches a baby (spoiler alert: He also punches a dog). It’s normally the kind of appalling behavioural breach that would sink a campaign like a stone, but The Campaign soon becomes a game of more-gaffe-prone-than-thou, with each transgression going viral, turning the small-district race into a source of national media amusement.

“We felt, ‘Why don’t we try to have a big, broad comedy that still has something to say,’" Ferrell says. “And if we can do it on a commercial level, we can kind of affect a lot more people.” They still kept several nods to real, and in many cases current, politics. A pair of power-hungry billionaires named The Motch Brothers (Dan Aykroyd and John Lithgow) are an admitted nod to the billionaire Koch Brothers, Tea Party bankrollers and active fundraiser for Mitt Romney.

“Oddly, the Koches are also one of the biggest contributors to the New York City Ballet,” Galifianakis says.

Having grown tired of the the bad boy in their pocket, the Motches decide to throw their wealth and political machinery behind the least-likely son of a county politico, “the weird one,” in their words. Marty runs a town bus tour, wears tacky sweaters and raises a corpulent family on junk food. The racism has been excised from the character, but the effeminate, Jesus-invoking aspects to the character remain.

In an ironic nod to Galifianakis’ history, the Motches also give Marty a cutthroat strategist (Dylan McDermott) who made his name flinging mud on behalf of Jesse Helms.

Why would power brokers pick the town flake as their new “boy”?

“He’s the unlikely choice, which with the Tea Party in vogue is the way to go,” Ferrell says. “You want the guy who’s outside the beltway and who’s like ‘I’m not one of them.’ “ Having the sympathetic underdog being a Republican was also deliberate, Galifianakis says. “We didn’t want to make peoples’ minds up for them. I like that this Republican is against the grain of what you’d expect from a Hollywood movie.”