MONTGOMERY, Alabama – It would be a mild understatement to say Tuesday’s outcome in the Alabama U.S. Senate special election was a shocker.

For the first time since Richard Shelby defeated then-Sen. Jeremiah Denton in the 1986 midterm election, a non-incumbent Democrat has beaten a Republican in a contest for U.S. Senate in the Yellowhammer State.

Former U.S. Attorney Doug Jones defeated former Alabama Supreme Court Chief Justice Roy Moore by an apparent 20,000-vote margin in the traditionally GOP-voting state.

Five things that went wrong for Moore:

1) Not having a unified GOP mattered

Earlier this month, Sen. Richard Shelby made it known he would be writing in a candidate instead of voting for the nominee chosen by the Republican voters of Alabama after allegations of sexual misconduct by Moore surfaced in a Washington Post report.

That was symbolic of what was going on with the Alabama Republican Party as a whole.

After the Post report broke, Republicans in the state party’s hierarchy were internally split on continuing to support Moore as the candidate. Instead of putting the focus on the election at hand, loyal party operatives were spending time putting fires out.

2) Margins of loss in urban counties was too much to overcome

The conventional wisdom before the election was Moore would have a difficult time in Alabama’s urban counties of Madison, Jefferson, Montgomery and Mobile. However, no one thought the margin would be that big.

In Republican-leaning Madison County, Moore lost by nearly 20,000 votes. In Jefferson County, Alabama’s largest county by population, he lost by over a 2-to-1 margin. In Montgomery County, it was nearly 3-to-1.

In Mobile County, a county in which Moore had success during the first two rounds of voting and could have been a secret weapon for Moore, he lost by 14 points.

Although Moore showed strength in the rural counties, those urban vote totals proved too much to overcome.

3) Alabama swing counties?

Tuscaloosa County, home to the University of Alabama and Lee County, home to Auburn University went big for Trump in 2016. Trump won Tuscaloosa by 19 and Lee by 23.

On Tuesday, they headed in the opposite direction and went Jones. The Democrat won each of those counties by 17 points.

Many people thought Jones could improve upon Hillary Clinton’s 2016 performance, but no one foresaw Jones winning and winning by such a margin.

https://twitter.com/AlongsideWild/status/940793696764747776

4) Turnout was much higher than predicted.

In the days leading up to Tuesday’s special election, Alabama Secretary of State John Merrill predicted turnout to be in the 20s. He initially said 20 percent, then revised it upward to 25 percent.

In the end, turnout came in at 40 percent, which is unheard of for an off-cycle special election in the month of December in Alabama.

High turnout marginalized Moore’s loyal base, which had been instrumental for Moore in the primary and the runoff.

40% turnout. A week ago, AL SoS Office was predicting half that https://t.co/2nDXB0roBU #alpolitics pic.twitter.com/SGNqRwDeRo — Jeff Poor (@jeff_poor) December 13, 2017

5) Moore was relying too much on a strong showing in the Wiregrass.

Moore campaign officials seemed to think their path to victory was in Alabama’s Wiregrass region.

He did well in the Wiregrass, winning it by more than a 2-to-1 margin over Jones. However, the 67,057 ballots cast for either Moore or Jones only accounted for 5 percent of the final vote tally — minuscule to the overall election.

Roy Moore's campaign, as evidenced by rural campaign stops, is relying on good voter turnout in the rural counties, the wiregrass region of Alabama (Dale, Coffee, Henry, Houston counties)—as well as maintaining support in the likes of Baldwin County. — Vaughn Hillyard (@VaughnHillyard) December 12, 2017

Follow Jeff Poor on Twitter @jeff_poor