Republican Glenn Youngkin secured victory over Democrat Terry McAuliffe in Virginia's governor election Tuesday, marking a stunning victory in a state that went solidly for Biden just a year ago. 

Tuesday night's defeat for McAuliffe was the culmination of a campaign plagued by self-inflicted wounds. 

In a debate sound bite that grew to define McAuliffe's candidacy, the Democrat said, "I don't think parents should be telling schools what they should teach."  

McAuliffe's campaign demonstrated repeated hostility toward the press. 

From McAuliffe walking out of an interview because he didn't like the questions, to his staff swearing at reporters and blocking questions, the campaign exhibited an almost paranoid defensiveness that reflected poorly on the candidate. 

McAuliffe also spent much of his bid campaigning against former President Trump - who doesn't hold any elected position and who never hit the campaign trail with Youngkin. 

Terry McAuliffe, Democratic gubernatorial candidate for Virginia, speaks during an election night event in McLean, Virginia, on Tuesday, Nov. 2, 2021. (Stefani Reynolds/Bloomberg via Getty Images)

McAuliffe himself seemed to recognize - perhaps too late - the error in building his strategy around someone mostly absent from the Virginia political scene, telling supporters just days ago that the election was "not about Trump" – after spending months communicating the opposite message. 

TEAM MCAULIFFE EMAILS REVEAL EFFORT TO ‘KILL THIS’ FOX NEWS STORY 

McAuliffe also leaned into associations with controversial left-wing figures. 

He praised a disgraced former appointee, who was forced to resign the last time McAuliffe was in office over racist and sexist tweets. He campaigned with Stacey Abrams, who became infamous for her refusal to accept her Georgia gubernatorial loss. And he closed out his campaign by prominently featuring Randi Weingarten, the controversial teachers union executive. 

Democratic gubernatorial candidate Terry McAuliffe prepares to speak at an election night party in McLean, Virginia, Tuesday, Nov. 2, 2021.  (AP Photo/Steve Helber)

And then there were the personal attacks. 

While virtually every statewide campaign - except, sometimes, in Utah - features mud-slinging, the McAuliffe campaign flailed wildly in its attempts to make Youngkin unpalatable to voters. 

McAuliffe claimed Youngkin would ban books by Black authors. 

His campaign amplified the Lincoln Project's haphazard smear attempt, in which fake racists were placed outside a Youngkin campaign event. (McAuliffe's campaign later condemned the stunt, but only after it backfired.) 

CLICK HERE TO GET THE FOX NEWS APP

McAuliffe even made a point out of condemning Youngkin's attire, and his spokesman attacked Youngkin's choice of songs for events. 

The attacks, like his campaign, were all over the place. And, like his campaign, they ultimately failed.