Virginia is home to religious right figures like televangelist Pat Roberson and his Christian Broadcasting Network, Jerry Falwell Jr. and his Liberty University, pundit and failed political candidate E.W. Jackson, and the National Rifle Association. It is now a blue state.

For months before the state elections, many Virginia Republican candidates tried to distance themselves from the Trump administration. But as Nov. 5 drew closer, many candidates and the Virginia Republican Party veered to the right and launched hateful attacks to stir up support among what they believed to be their base of conservative voters. With Tuesday’s earthshaking election results in the former Confederate state, it’s clear that right-wing fear-mongering tactics didn’t work.

Virginia Democrats flipped both the state House and the state Senate, winning control of both chambers for the first time in more than two decades. Democrats picked up at least two Senate seats, and another five in the House. A few close races are still undecided, but Virginia is now blue with Democrats in control of the House, the Senate, and the governorship and positioned to pass legislation on reproductive rights, fix the state’s voting laws, which are among the worst in the nation, and advance other progressive agenda items. Notable wins include Democratic Delegate Kelly Fowler, who overcame racist attacks, and Democratic Delegate Danica Roem, who overcame anti-LGBTQ bigotry.

The Virginia elections were widely seen as a signal of how voters will cast their votes in 2020 presidential election. While Democrats traditionally turn out in lower numbers during midterm election years, disapproval of President Donald Trump and the Republican Party served as motivation for voters to get to the polls in 2018, as they did again this Tuesday. Trump has a 53 percent disapproval rating in the state and a dismal 27 percent approval rating. As popular as Trump may be among the state’s Republican base, that base is a shrinking portion of the electorate, and his extremely divisive leadership style is likely to further alienate independents from the GOP.

In the lead up to the race, many Republicans tried to portray themselves as moderates, campaigning on such issues as health care, schools, and transportation, and some even left their party affiliation off their campaign materials.

But weeks prior to the election, the state Republican party upped their attacks and turned to fear-mongering. Their Democratic opponents were “socialists,” who wanted to kill babies and welcomed illegal immigrants to commit crimes in Virginia. Other attacks, like that on Fowler, were simply racist or, as was the case for Roem, bigoted. But the fear-mongering tactics backfired.

Fowler won her reelection bid against Republican Shannon Kane in Virginia Beach. Kane had portrayed herself as a businesswoman, but in late October, she authorized racist mailers, paid for by the Virginia Republican Party, that photoshopped Fowler in next to MS-13 gang members. (Fowler is of Mexican and Filipino descent.) The mailers also claimed Fowler “openly welcomes Illegal Immigrants into our community putting our families safety at risk.”

But Fowler used the mailers to garner support and turn out voters. In a campaign email, she pointed to the racism and xenophobia in the mailers and asked for help. “It’s appalling to see my opponent send out a mailer to thousands of community members that aligns me with dangerous gang members just because I am Latinx. Can you help us fight back against this racist ad?” she asked in the email. It worked.

Roem, meanwhile, overcame anti-LGBTQ bigotry to become first openly transgender lawmaker reelected in Virginia. She faced the Prince William County Republican Party tweeting a snide suggestion that Roem is wrong to refer to herself as a mom, while the Family Foundation Action group ran online advertisements, thick with anti-trans rhetoric.

The Virginia results also suggest that the religious right strategy to paint pro-choice legislation as “infanticide” or “birthday abortion”—a strategy highlighted at the Values Voters Summit held by the Family Research Council in October—might not fare as well as its proponents anticipate on a national scale. In Virginia, this line of attack, led by right-wing groups like Susan B. Anthony List, was aimed at Kathy Tran’s pro-choice bill and comments made by Tran and Virginia Gov. Ralph Northam about the legislation. But Tran won her reelection bid. Fowler, who campaigned while pregnant, was also accused of supporting “infanticide” by her opponent; she welcomed and overcame the attacks.

There were, of course, Republican candidates who were Trumpian from the beginning and all the way through. Virginia State Senator Amanda Chase, who ran against Democrat Amanda Pohl, was described by right-wing Virginia radio host John Fredericks as “an unabashed, 100 percent advocate and supporter of President Trump.” John Gray, the Republican nominee to chair the Prince William County Board of Supervisors, tried to delete a series of sexist, Islamophobic, and racist tweets, only to defend some of them after his opponent surfaced them.

Gray lost to Democrat Ann Wheeler. Voters in Prince William who spoke to the Washington Post admitted they knew little about Gray or Wheeler, but pointed to Gray’s rhetoric, suggesting they came to vote against such ideas.

Tuesday’s vote was, in part, a referendum on Trump’s right-wing policies and rhetoric, which are supported by the national Republican party. Virginia Republicans tried both to distance themselves from the national scene, and then when desperate, to rally the hard-right troops with appeals to Trump-like fear-mongering. But in the face of voter disgust and determined progressive organizing, they failed.