HOMEWOOD, Ala. — Roy S. Moore, a former chief justice of the State Supreme Court, and Senator Luther Strange emerged from a crowded Republican field on Tuesday in a special Senate primary in Alabama, according to The Associated Press. They will face off for their party’s nomination next month in a runoff election, a contest that will test President Trump’s clout in a deeply conservative state.

Neither Mr. Strange, 64, backed by Mr. Trump and millions of dollars in spending by outside groups, nor Mr. Moore, 70, a favorite of evangelical voters, received more than 50 percent of the vote in a race that evolved into seeing who could embrace Mr. Trump more when the leading contenders were closely aligned on policy.

But Mr. Moore significantly outpolled Mr. Strange, taking 39.6 percent of the vote to the senator’s 32.1 percent, with 91 percent of precincts reporting as of 11:35 p.m. Eastern time. Representative Mo Brooks, a hard-line conservative, finished third with 19.8 percent of the vote.

Taking the stage after it became clear he and Mr. Strange would enter the runoff, Mr. Moore predicted a wave of “the most negative campaign ads in the history of Alabama,” and he leveled sharp attacks against Republican leaders. Tuesday’s results, he said, showed that “the attempt by the silk-stockinged Washington elitists to control the vote of the people of Alabama has failed.”