MONTGOMERY, Ala. — Senator Luther Strange used every opportunity he had at a Republican candidate forum here on Thursday to invoke his support from President Trump as he defended his seat against former state Supreme Court Justice Roy Moore, who unfurled a litany of accusations against Mr. Strange and ridiculed his reliance on the president’s endorsement just days before they face off in Alabama’s special Senate election.

Mr. Strange, who was appointed to fill the seat vacated by Attorney General Jeff Sessions, is wagering that his only path to victory next Tuesday is through embracing the president and attempting to make the race a Trump referendum.

Trailing in the polls against Mr. Moore, who enjoys a devoted following among fellow evangelicals, Mr. Strange argued on Thursday that Mr. Trump’s surprise decision to intervene in the campaign and join him at a rally amounted to a seal of approval in a state where the president is deeply popular among Republicans.

He was unabashed about referring to his telephone conversations with the president, explaining how the two newly sworn-in Republicans had bonded this year as he dismissed the increasingly audible snickering from the audience at every mention of Mr. Trump.