(CNN) It hasn't happened in more than a decade, but it might just happen on Tuesday.

The last time a Democrat won a major statewide election in Alabama was in 2006, when Jim Folsom Jr., a former Alabama governor, won the lieutenant governorship after more than a decade out of politics. He won the seat against none other than Luther Strange, the Trump-backed incumbent who lost the primary to Moore this fall.

Folsom Jr., who comes from a famous Alabama political family (his dad was a two-term governor), won with a populist message that sounds straight out of 2016 : The need to bring tens of thousand more manufacturing jobs to the state , invest in infrastructure and expand the military's presence. He boasted about his his love of church, leisure time spent hunting and years of experience in business. He said he'd work like an independent.

Moore: We are up to our neck in alligators

Moore: We are up to our neck in alligators 01:32

Moore: We are up to our neck in alligators

Folsom Jr. didn't win his lieutenant governor race in 2006 just by pure luck, though. With his deep connections in Alabama politics (including a dad who was known as "kissing Jim" ), he won the right places, the kind that Democratic candidate Doug Jones will need to win too, if he's to be carried to victory.

Republican hopeful Roy Moore has campaigned through multiple allegations of sexual misconduct -- fending off calls for his ouster from congressional Republicans while gaining the endorsement of President Donald Trump -- to find himself on the cusp of winning a seat in the Senate.

But while the state is deep red today, Democrats have won before in Alabama, and a look at Trump's win, Moore's almost-loss and the 2006 lieutenant governor's race could give a road map to how it might happen again.

The 2006 race for lieutenant governor: Last major statewide race to go blue

The first place to watch is the "Black Belt" across the middle of the state, named for the black soil in that strip of land and known for its heavily African-American population. The nine counties with the largest pro-Folsom margin were found in this band of counties. And that doesn't even include Montgomery County -- home to the state's capital and the fourth-largest share of the vote in the 2006 race -- which delivered the largest raw vote margin for Folsom. This strip of counties is also home to nearly all of the majority-black counties in the state.

The other notable county to watch for Democrats is Jefferson County, home to the state's largest city of Birmingham and the highest share of the vote in the race. Even though Folsom won Jefferson County by only four points during his win in 2006, it was his second-largest raw margin of victory in the state. (The county accounted for one in seven votes cast in that race.)

JUST WATCHED Jones says he was unaware of Obama robocall Replay More Videos ... MUST WATCH Jones says he was unaware of Obama robocall 00:45

But Folsom needed more than just the Black Belt and Jefferson County to win in dark red Alabama. He cut -- or even reversed -- Republican margins across the state, especially in counties surrounding Jefferson County -- like Tuscaloosa, Etowah, Talladega and Walker.

He also held the GOP margin to single digits in populous strongholds like Mobile and Madison, and he did excellently in the state's northwest, which have some of the highest-density of non-college educated whites. In counties like Franklin, Colbert, Lauderdale and Lawrence, Folsom earned as much as 68% of the vote.

Donald Trump's map: The typical GOP path to victory in Alabama

Democratic 2016 nominee Hillary Clinton won both major Democratic areas of the state in 2016: a dozen counties across the Black Belt -- most notably Montgomery -- plus Jefferson County. Jefferson County has delivered narrow margins to Democrats over the past decade, including a margin of seven points for Clinton in 2016 and a margin of six points for Barack Obama in 2012.

The main difference between Trump's map and Folsom's map? It's not Democrats running up the score in the solid blue counties. It's stripping away Republican support in the plethora of small, typically-Republican counties and winning handily in the state's heavily non-college educated northwestern counties.

Trump's margins of victory in the biggest eight counties in the state -- which account for roughly half of the votes cast in a statewide election -- were an average of nine points larger than Strange's margin there in 2006. In the rest of the counties, Trump's margin of victory in 2016 was, on average, 47 points wider than Strange's in 2006.

Trump, like most Republicans, won across all other regions of the state, from Madison County in the far northern part of the state to Mobile County in the far southern part of the state, near Trump's rally in Florida just days ago. Other typically Republican counties with important populations include Baldwin County, Tuscaloosa County, Lee County and Shelby County, which includes the crucial suburbs of Birmingham.

In the far northwest, where the long stretch of counties with high populations of non-college educated whites that starts in the Rust Belt dips into the South, Trump shifted the demographic advantage typically enjoyed by Republicans, outperforming Romney the most. In Franklin, Colbert, Lauderdale and Lawrence, Trump improved on Romney's margins by as much as 11 points.

The time Moore almost lost: The 2012 race for the state Supreme Court

Moore has won statewide before, but not in a landslide. The last time Moore ran for statewide office, he won by a 52% to 48% margin in an election for chief justice of the state Supreme Court. The reason for his win? Holding onto small rural counties by just enough to eke out the victory.

Moore lost Jefferson County in 2012 -- which went for Democrats Clinton, Obama and Folsom by single digits -- by a broad 26-point margin. In next-door Shelby County, which includes the suburbs of Birmingham, Moore won by 27 points -- roughly half the broad margin by which Trump carried the county.

He got demolished in Montgomery County, the most populous spot in the Black Belt, by a whopping 42 points. He even lost the GOP's populous strongholds of Mobile County and Madison County by single digits -- both places Trump won in 2016 and Strange won in 2006.

But Moore went on to outperform Strange -- while still underperforming Trump -- in rural counties across the state, dragging his campaign across the finish line for a victory anyway.

Winning the nomination: How Roy Moore defeated Luther Strange

Strange only won four counties in his Trump-backed bid for the Republican nomination a few months ago: Madison County, Shelby County, Sumter County and Jefferson County.

Two of these are Clinton counties: Sumter is part of the Black Belt running through the central part of the state. Strange won it by 19 points. (Still, only a quarter of its 13,000 residents are white -- and the rest are likely to overwhelmingly vote for Jones.)

Jefferson County, on the other hand, poses much more of a threat to Moore. It's the most populous county in the state, but it's also one of the top five most-educated. Strange won the county by 17 points in the GOP primary runoff -- and college-educated whites there may be reluctant to rally around Moore in the general election.

Shelby and Madison counties -- the other two areas Strange won by single-digits -- are the two most educated counties in the state. Shelby includes the southeast suburbs of Birmingham and Madison includes Huntsville. That means these aren't small areas either: these two counties combined to account for one-in-eight votes cast in the 2016 presidential race.

CORRECTION: This story has been updated to reflect that Birmingham is Alabama's largest city, not its capital.