A police officer approached former President Donald Trump’s would-be assassin but failed to stop him before shots were fired at the campaign rally in Butler County, Pennsylvania.

Thomas Matthew Crooks attempted the assassination with a rifle from an elevated position on a manufacturing plant roof roughly 130 yards away from the former president. Bystanders saw Crooks before he fired his weapon and notified nearby police.

An officer then climbed a ladder up the platform and was met by Crooks pointing his rifle toward him, law enforcement officials told The Associated Press. The officer retreated down the ladder, and Crooks shot at Trump shortly after.

Crooks, 20, fired several rounds towards Trump at the rally, one of which clipped the former president’s ear. The gunfire killed a rally attendee and gravely wounded two others, according to law enforcement.

Crooks was shot and killed by the Secret Service seconds after he fired his weapon.

The reported encounter between local law enforcement and Crooks follows eyewitness testimony of the events leading up to the attempted assassination.

Greg Smith, who was listening to Trump’s speech outside the rally, told BBC he noticed Crooks climbing up the building and attempted to notify police for several minutes.

“We noticed the guy bear-crawling up the roof of the building beside us, 50 feet away,” he said. “He had a rifle, we could clearly see a rifle.”

“We’re pointing at him. The police are down there running around on the ground, we’re like, ‘Hey man, there’s a guy on the roof with a rifle,’… and the police did not know what was going on,” he continued.

Easton Smith, another eyewitness outside the rally, told WKBN he and others noticed Crooks with a rifle and were “trying to alert cops and police there was a guy crawling on the roof.”

“After that, a couple shots fired off,” he said.

Crooks’ motivations are unclear. Records revealed he was registered as a Republican but donated $15 to a left-wing political action committee the day of President Joe Biden’s inauguration.

Trump was taken to a hospital in Pennslyvania after the shooting and then flew to New Jersey late Saturday night. He posted a statement Sunday morning on Truth Social that emphasized the need to unify in the aftermath of the attempt on his life.

“Thank you to everyone for your thoughts and prayers yesterday, as it was God alone who prevented the unthinkable from happening,” he wrote. “We will FEAR NOT, but instead remain resilient in our Faith and Defiant in the face of Wickedness. Our love goes out to the other victims and their families.”

“We pray for the recovery of those who were wounded and hold in our hearts the memory of the citizen who was so horribly killed,” he continued. “In this moment, it is more important than ever that we stand United, and show our True Character as Americans, remaining Strong and Determined, and not allowing Evil to Win. I truly love our Country, and love you all, and look forward to speaking to our Great Nation this week from Wisconsin.”

Biden said on Sunday that he spoke briefly with Trump. The president delivered an address the previous day, declaring that “an assassination attempt is contrary to everything we stand for as a nation.”

“It’s not who we are as a nation. It’s not American. And we cannot allow this to happen,” he said. “Unity is the most elusive goal of all, but nothing is more important than that right now.”