Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Sen. Luther Strange, R-Ala., and former Alabama Chief Justice Roy Moore will meet in a runoff next month to determine who will earn the GOP nomination to fill Attorney General Jeff Sessions' Senate seat, the Associated Press projected Tuesday.

Moore cruised to a first-place finish in the Republican side of the special Senate primary, getting 38.9 percent of the vote with all of the state's counties reporting.

Strange, the incumbent who received the backing of President Donald Trump, came in second, with 32.8 percent of the vote.

Rep. Mo Brooks, R-Ala., a Tea Party favorite who’d consistently attacked Strange for being an “establishment candidate” with ties to Senate Majority Leader Mitch McConnell, R-Ky., finished in third place, with 19.7 percent, and will not advance to the Sept. 26 runoff. Brooks declined to endorse either of his competitors following his loss.

Strange, who had been appointed earlier this year to fill the Senate seat vacated by Sessions, got a big boost in the final days of the race after Trump publicly backed him and began recording robocalls for him, urging Alabama GOP voters to support his choice of candidate.

Speaking to reporters late Tuesday, Strange refrained from criticizing Trump's comments earlier in the day blaming "both sides" for violence in Charlottesville, Virginia, over the weekend. Strange said he welcomed all the help he can get from the president, and advisers to the campaign said they expected Trump to campaign for Strange before the runoff election.

Congratulation to Roy Moore and Luther Strange for being the final two and heading into a September runoff in Alabama. Exciting race! — Donald J. Trump (@realDonaldTrump) August 16, 2017

Trump, however, praised both candidates in a tweet Wednesday morning, offering a "Congratulation to Roy Moore and Luther Strange for being the final two and heading into a September runoff in Alabama."

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"Exciting race!" Trump tweeted.

Wow, Senator Luther Strange picked up a lot of additional support since my endorsement. Now in September runoff. Strong on Wall & Crime! — Donald J. Trump (@realDonaldTrump) August 16, 2017

Hours later, though, he took credit for Strange's advancement to the runoff, tweeting, "Wow, Senator Luther Strange picked up a lot of additional support since my endorsement. Now in September runoff. Strong on Wall & Crime!"

Former Alabama Chief Justice and U.S. Senate candidate Roy Moore speaks to supporters during his campaign party on August 15, 2017 in Montgomery, Alabama. Brynn Anderson / AP

Moore, meanwhile, capitalized on his popularity among religious conservatives in the state to propel himself to his first-place finish.

"WE'RE ON TO THE RUNOFF! Time for Conservatives across Alabama to unite and deliver a knockout punch to the establishment! #ALSen," he tweeted Tuesday night, after the race was called.

WE'RE ON TO THE RUNOFF!



Time for Conservatives across Alabama to unite and deliver a knockout punch to the establishment! #ALSen pic.twitter.com/jN1nJHt02o — Judge Roy Moore (@MooreSenate) August 16, 2017

Moore made national headlines in 2003 when he was removed for office after refusing to take down the stone Ten Commandments he had installed on the grounds of the state judicial building. He was elected chief justice again in 2012, but suspended once more last year for refusing to enforce the U.S. Supreme Court’s ruling legalizing same-sex marriage.

Moore would have had to earn 50 percent of the vote to avoid a runoff.

On Wednesday, he doubled down on presenting himself as an outsider candidate and said he continued to support Trump, even though the president had endorsed Strange in the primary.

"I can’t help what they do behind doors in Washington D.C. Of course I support the president’s agenda," Moore said on Fox News. "I have supported him throughout and I don’t know why he did what he did, but that’s his decision not mine."

Despite Moore’s first-place finish, attention on the race had mostly been focused on how all three of the Republican candidates had spent much of their energy trying to take advantage of Trump’s sustained popularity in the Cotton State.

Senator Luther Strange walks in to cast his vote on August 15, 2017 in Homewood, Alabama. Butch Dill / AP

Throughout the campaign, Strange (who called Trump’s election a "Biblical miracle”), Moore (who said "God…sent Donald Trump in there”) and Brooks (who vowed to read the King James Bible on the Senate floor until the president's border wall gets built) took turns vying for the attention of the state’s GOP voters, who still overwhelmingly approve of Trump, even as his national job approval ratings plummet.

Even with Trump’s backing, however, Strange’s advancement to the runoff wasn’t without challenges. He was dogged by questions about his appointment to Sessions' seat by former Gov. Robert Bentley, who was shortly thereafter driven out of office by a sex scandal

He also had the backing of McConnell, and a super PAC affiliated with the Kentucky senator spent millions in ads on the race.

Brooks, for his part, attracted negative attention after he ran a campaign ad using audio from the June shooting that injured House Majority Whip Steve Scalise (R-La.). Brooks attended the practice.

Low turnout also likely played a factor in the outcome. Alabama secretary of state John Merrill on Tuesday morning predicted just 10 percent to 15 percent of voters would turn out for the race.

Candidate Doug Jones, left, jokes with former Alabama state Sen. Ray Campbell before a Democratic Senate candidate forum at the Princess Theatre on August 3, 2017 in Decatur, Alabama. Jeronimo Nisa / The Decatur Daily via AP file

On the Democratic side, Doug Jones, a former U.S. attorney appointed by Bill Clinton who has been involved in Alabama politics for decades, easily bested seven other candidates for his party’s slot in the general election.

With all counties reporting, Jones received 65.6 percent of the vote, the Associated Press reported, avoiding a runoff.

He nevertheless faces a near-impossible path to victory in December against the eventual Republican candidate. Alabama voters haven’t elected a Democrat to the U.S. Senate since 1992 and haven’t elected a Democratic governor since 1998.