President Trump is backing Republican candidate Roy Moore in the Alabama Senate race because he wants someone who backs his policies, White House spokesman Hogan Gidley said hours after Trump extended an endorsement to the controversial candidate on Monday.

"As we've said on multiple occasions, the president would much rather have someone in the Senate who supported his agenda as opposed to someone who did not," Gidley told reporters traveling aboard Air Force One on Monday.

Trump had withheld his support of Moore after more than a half-dozen women accused the former state Supreme Court judge of pursuing sexual relationships with them when they were teenagers and he was in his 30s.

But Trump encouraged his supporters in Alabama on Monday to vote for Moore because a victory in the special election contest there would provide Trump with a vote for his legislative agenda.

"The president did speak briefly with Mr. Moore this morning from Air Force One to talk about the state of the race in Alabama and also to offer his endorsement," Gidley said.

Voters in Alabama will decide between Moore and Democratic candidate Doug Jones on Dec. 12.