Donald Trump speaks at a campaign rally Wednesday night in Long Island. Spencer Platt/Getty Images

Donald Trump, speaking in Long Island Wednesday after being the target of two assassination attempts in as many months, told his supporters that "God spared his life" so that he can win New York, a state where no Republican presidential candidate hasn't won since Ronald Reagan in 1984.

"God has now spared my life. It must have been God, not once, but twice," the former president told the crowd at the Nassau Coliseum.

"There are those that say he did it because Trump is going to turn this state around. He's going to turn this country around. He's going to make America great again," he continued at the event in Uniondale.

The Republican presidential nominee, who lost in New York by 23 points in 2020 and 2016, said his "encounters with death" have only strengthened his resolve.

"They have really given me a much bigger and stronger mission," Trump, 78, said. "They've only hardened my resolve to use my time on earth to make America great again for all Americans and to put America first."

"The reason I'm here," is because "we are going to win New York."

Trump held the rally in Long Island three days after a Secret Service agent fired at a man with an AK-47-style rifle hiding in the bushes of his golf resort in West Palm Beach, Fla. The gunman was captured and charged.

Trump was not injured.

On July 13, Trump was grazed in the ear by an assassin's bullet while speaking at a rally in Butler, Pa. Secret Service snipers fatally shot the gunman.

The former president said during his speech that people doubted him when he said he would campaign in New York.

"When I told some people in Washington I'm going up to New York, we're doing a campaign speech, they said, 'What do you mean New York? You can't ever. Nobody can win. Republicans can't win.' I said, 'I can win New York and we can win New York. We're going to win New York!'" he said.

Trump has raised the prospect of divine intervention before.

In an interview a day after the assassination attempt in Butler, he told the New York Post that he was "supposed to be dead."

"By luck or by God, many people are saying it's by God I'm still here," he said.

The most recent poll in New York shows Vice President Kamala Harris leading Trump by nearly 17%.

The ActiVote survey was taken between Aug. 1 and Aug. 21. It has a 4.9 percentage point margin of error.