Republican Ron DeSantis defeated Democrat Andrew Gillum in the Florida governor’s race on Tuesday night, an upset that will entrench Republican power across the state government.

DeSantis is a Donald Trump acolyte who served as a Tea Party congressman before resigning to focus on this race. He ran on a reactionary platform, opposing reproductive rights, gun control, sanctuary cities, and Medicaid expansion. On his first day in office, he will have an opportunity to appoint three new justices to the Florida Supreme Court, swinging the state judiciary far to the right. Because Republicans maintained their grasp on the state Legislature, DeSantis can swiftly pass legislation restricting abortion, loosening environmental regulations, and targeting immigrant communities. The newly conservative court will likely rubber-stamp these measures, turning Florida into a laboratory for hard-right conservative policy.

In the weeks before Election Day, most polls predicted a fairly comfortable Gillum victory. The 39-year-old mayor of Tallahassee, Gillum ran an unapologetically progressive campaign, supporting Medicaid expansion, gun control, a corporate tax hike, a higher minimum wage, and the abolition of private prisons. DeSantis, meanwhile, relied upon Fox News appearances and racist dogwhistles to whip up the GOP base. He also refused to return a donation from a campaign contributor who called President Barack Obama the N-word. As a congressman, DeSantis spoke to alt-right groups that espoused racist ideology, associations he declined to disavow on the campaign trail.

But Gillum had his own problems—namely, an FBI investigation into corruption in the Tallahassee government. The probe did not directly implicate the mayor, but it did cast a cloud over his candidacy. Perhaps more importantly, Gillum ran as an unapologetically black candidate, and white nationalists launched bigoted attacks designed to malign him on the basis of his race. One robocall began with the line “I is the negro Andrew Gillum” spoken in a grossly offensive minstrel dialect. It would be naive to dismiss the role that racism played in this election.

At the same time that voters put DeSantis in the governor’s mansion, they amended their state Constitution to automatically restore voting rights to rehabilitated felons. That means about 1.5 million people who are currently disenfranchised—a disproportionate number of them racial minorities—will be able to vote in the next election. DeSantis’ grasp on power may be firm at the start. But he will soon have to contend with an electorate that is much more diverse than the one that put him in office.