Republican Ed Gillespie has had to fend off some zingers — "Establishment Ed," "Enron Ed" — while running for governor of Virginia.

But “architect of gerrymandering”?

That one fell flat when Democrat Ralph Northam lobbed it at Gillespie this month during their final debate. The insult seemed obscure. And Gillespie brushed it off with an attempt at humor: “In my history books, it’s Elbridge Gerry who came up with gerrymandering.”

Gillespie did, in fact, take partisan mapmaking to a new level, but just try turning that into a bumper sticker.

While he is better known as the former chairman of the Republican National Committee, a Washington lobbyist and a counselor to President George W. Bush, Gillespie helped pull off a stunning political coup — one that gave Republicans unprecedented muscle to reshape the nation’s congressional maps to their advantage.

Right after President Barack Obama’s 2008 win, Gillespie helped dispirited Republicans claw back into power one statehouse at a time.

Instead of asking donors for the big bucks needed to swing congressional races, they focused on legislative contests in certain states — those where Republicans needed to flip only a few seats to win control of the legislatures and the mapmaking that would occur after the 2010 Census.

Named "REDMAP," the project helped the GOP win control of 22 state legislatures in 2010, paving the way for GOP gains in Congress in 2012, even as Obama won reelection.

To some, it was a triumph, a bold and perfectly legal tactic deployed in plain sight of Democrats. To others, it was an affront to democracy, the root of the no-compromise politics that’s left Washington gridlocked. Or some combination of both.

Liberal MSNBC host Rachel Maddow gushed over the "political genius" of the scheme, even as she lamented the fate of "blindsided Democrats" all across the country.

“Do you mind if I lock you in an airless vault before we leave here tonight and never let you out?” she joked in a 2015 interview with Chris Jankowski, the GOP strategist who led REDMAP with Gillespie.

Jankowski, now chief consultant to the Republicans running for Virginia attorney general and lieutenant governor alongside Gillespie, laughed with Maddow and said it was a “team effort.” Then he tipped his hat to one person by name: Gillespie.

Their REDMAP project was efficient and effective.

“In early 2010, Gillespie and Jankowski took a PowerPoint presentation on the road,” wrote David Daley, author of a book on REDMAP focused on the efforts of Gillespie, Jankowski and GOP strategist Karl Rove. “They met with Wall Street donors, oil magnates, hedge-funders, Washington lobbyists and trade associations — anyone open to an audacious, long-term play.”

“Gillespie is the rainmaker, really,” Daley said in an interview with The Post. “Goes off on a year-long fundraising tour and shakes the trees and comes up with $30 million at least. . . . ‘You will save hundreds of millions if you fund this instead of everything else.’ ”

The plan was no secret. Rove laid it out in a 2010 Wall Street Journal commentary sub-headlined: "He who controls redistricting can control Congress."

Gerrymandering is gaining new attention now, as the Supreme Court considers whether extreme partisan mapmaking is constitutional. Two lawsuits over Virginia's legislative maps are pending, one before a federal three-judge panel, the other before the state Supreme Court.

Former president Obama and his first attorney general, Eric H. Holder Jr., are leading Democrats' call for fairer maps. At an Oct. 19 rally for Northam in Richmond, Obama lamented how districts are drawn in a way that forces politicians to cater to extremes.

“Ralph wants to end the practice of gerrymandering so our districts are drawn in a nonpartisan way,” Obama said. “We shouldn’t have politicians choosing their voters; we should have voters choosing those who would serve them. That’s one more difference between him and his opponent.”

Holder, chairman of the National Democratic Redistricting Committee, stumped in Norfolk, Virginia Beach and Richmond on Saturday and Sunday for the Democratic ticket.

“During the last round of national redistricting, Ed Gillespie was the chief architect of a plan to lock in political power for Republicans and lock out the voice of the voters in Virginia and states around the country,” Holder wrote in a statement to The Washington Post. “Gerrymandering is a threat to our democracy. It creates districts in which the electoral outcome is predetermined for one party, effectively diminishing the voting power of citizens and providing incentives for politicians to cater to the fringes of their parties.”

The winner of the Nov. 7 governor’s race will control, along with Virginia’s currently GOP-led General Assembly, how the state’s maps are drawn after the 2020 Census.

Holder’s group has donated $950,000 to the Democratic Party of Virginia this year. Republicans say the giving shows that the Democrats are merely trying to play catch-up, not pushing for nonpartisan maps.

Even with renewed focus on gerrymandering, the issue still seems arcane to many voters.

“We, as voters, often don’t understand the importance of redistricting and gerrymandering,” Daley said. The book gets its title from a profane term for political sabotage. Its subtitle: “The true story behind the secret plan to steal America’s democracy.”

“It’s a concept that put us all to sleep in civics class in high school,” said Daley, former editor in chief at Salon. “But that’s why the politicians have been able to exploit it — because it seems to us it’s simply politics as usual, or it’s boring, or it’s inside baseball. It’s none of those things. These district lines are the building blocks of our democracy. And when they get twisted in this way, it twists the very notion of republican democracy into something that is unrecognizable.”

In response to questions about Gillespie’s role in REDMAP, campaign spokesman David Abrams issued a statement: “Ed will closely assess proposals for reforms to Virginia’s existing redistricting process. In his ten years in office, Lt. Gov. Northam has done nothing to eliminate partisan redistricting maps. In fact, he’s voted to gerrymander his own district.”

Abrams is referring to Northam’s vote in 2011 for a state Senate map that made his swing district more blue. It was drawn under a deal struck between leaders of the GOP-dominated House of Delegates and the state Senate, then under Democratic control. Republicans got to draw maps for the House, Democrats for the Senate.

“Ralph Northam has supported nonpartisan redistricting since his first campaign in 2007, and 2011 was an attempt at bipartisan compromise,” said Christina Freundlich, a Northam spokeswoman. “Ed Gillespie literally called his project REDMAP. You can’t get much more blunt about gerrymandering than that.”

In a May interview with The Washington Post, Gillespie pushed back against the notion that REDMAP undermined democracy.

“We were very successful,” Gillespie said. “And there was no doubt in 2010 we put a focus on state legislatures that would have a significant impact in the redistricting process. I think it was a smart plan. No secret about it. . . . I’m proud of the work that we did there, and I’m proud of the work that state legislatures are doing. You know, we have, I think, now 69 of the 99 state legislative chambers are in Republican hands, including the state House and the state Senate in Virginia.”

Jankowski declined to be interviewed.

Both parties have long histories of gerrymandering — an ignominious tradition that goes back to Virginia’s first governor.

Patrick Henry drew the boundaries of Virginia’s 5th Congressional District in an unsuccessful bid to keep James Madison out of the House, said Brian Cannon, executive director of the redistricting reform group OneVirginia2021.

Modern gerrymanderers have tools that could not have been imagined by Henry in 1788 or Gerry, the Massachusetts governor Gillespie invoked in the debate, who gave partisan mapmaking its name with the salamander-shaped district he ordered up in 1812. And certain advances arrived just in time for REDMAP, which mashed up data on voting, education, income, magazine subscriptions and even consumer purchases to guide mapmaking, Cannon said.

“Technology got really good, so they were able, with their gains, to exploit it better than anybody ever had before,” Cannon said. “They know you vote in Republican primaries but also know you subscribe to Guns and Ammo and buy Crest.”

Republicans first put the maps to the test in 2012. And they worked, despite Obama’s reelection and Democratic victories in 69 percent of U.S. Senate elections that November. Despite the fact that Democrats won more than 1 million more votes than Republicans in House races around the country, the GOP scored a 33-seat majority in the 113th Congress.

The REDMAP group gave some of the credit to the quality of their candidates and other factors, but at the heart of it all were the maps tilted in their favor, strategists said.

“All components of a successful congressional race . . . rest on the congressional district lines,” the REDMAP website declared, “and this was an area where Republicans had an unquestioned advantage.”