BUTLER, Pa. — Donald Trump appeared to be the target of an assassination attempt as he spoke during a rally in Pennsylvania on Saturday, law enforcement officials said. The former president, his ear covered in blood, was quickly pulled away by Secret Service agents and his campaign said he was “fine.”

A local prosecutor said the suspected gunman and at least one attendee are dead. It wasn’t immediately clear if Trump was shot.

The attack, by a shooter who law enforcement officials say was then killed by the Secret Service, was the first attempt to assassinate a president or presidential candidate since Ronald Reagan was shot in 1981. It comes amid a deeply polarized political atmosphere, just four months from the presidential elections and days before Trump is to be officially named the Republican nominee at his party’s convention.

“President Trump thanks law enforcement and first responders for their quick action during this heinous act,” spokesman Steven Cheung said in a statement. “He is fine and is being checked out at a local medical facility. More details will follow.”

The Secret Service said in a statement that “the former President is safe.” Trump’s eldest son, Donald Trump Jr., said after 8 p.m. that he spoke to his father on the phone and that “he is in great spirits.”

“There’s no place in America for this type of violence,” President Joe Biden, who is running against Trump as the presumptive Democratic nominee, said in remarks. “It’s sick. It’s sick.”

Two officials spoke to The Associated Press on the condition of anonymity to discuss the ongoing investigation. They said the shooter was not an attendee at the rally and was killed by U.S. Secret Service agents.

The officials said the shooter was engaged by members of the U.S. Secret Service counterassault team and killed. The heavily armed tactical team travels everywhere with the president and major party nominees and is meant to confront any active threats while other agents focus on safeguarding and evacuating the person at the center of protection.

It’s still not clear yet whether Trump was struck by gunfire or was injured as he was pulled to the ground by agents.

Butler County district attorney Richard Goldinger said in a phone interview that the suspected gunman was dead and at least one rally attendee was killed.

Trump, the presumptive Republican nominee, was showing off a chart of border crossing numbers during his last rally before the Republican National Convention opens Monday when the apparent shots began.

It took two minutes from the moment of the first shot for Trump to be placed in a waiting SUV.

As Trump was talking, a popping sound was heard, and the former president put his right hand up to his right ear, as people in the stands behind him appeared to be shocked.

As the first pop rang out, Trump said, “Oh,” and grabbed his ear as two more pops could be heard and he crouched down. More shots are heard then.

Someone could be heard saying near the microphone at Trump’s lectern, “Get down, get down, get down, get down!” as agents tackled the former president. They piled atop him to shield him with their bodies, as is their training protocol, as other agents took up positions on stage to search for the threat.

Screams were heard in the crowd of several thousand people. A woman is heard screaming louder than the rest. Afterward, voices were heard saying “shooter’s down” several times, before someone asks “are we good to move?” and “are we clear?” Then, someone ordered, “Let’s move.”

Trump could be heard on the video saying at least twice, “Let me get my shoes, let me get my shoes,” with another voice heard saying, “I’ve got you sir.”

Trump got to his feet moments later and could be seen reaching with his right hand toward his face. There appeared to be blood on his face. He then pumped his fist in the air and appeared to mouth the word “Fight” twice his crowd of supporters, prompting loud cheers and then chants of “USA. USA. USA.”

The crowd cheered as he got back up and pumped his fist.

His motorcade left the venue moments later. Video showed Trump turning back to the crowd and raising a fist right before he is put into a vehicle.

Reporters covering the rally heard five or six shots ring out and many ducked for cover, hiding under tables.

After the first two or three bangs, people in the crowd looked startled, but not panicked. An AP reporter at the scene reported the noise sounded like firecrackers at first or perhaps a car backfiring.

But then there were more shots. Panic set in as people realized what was happening. Shouts of “Get down!” rang through the crowd.

When it was clear the situation had been contained and that Trump would not be returning to speak, attendees started filing out of the venue. One man in an electric wheelchair got stuck on the field when his chair’s battery died. Others tried to help him move.

Police soon told the people remaining to leave the venue and U.S. Secret Service agents told reporters to get “out now. This is a live crime scene.”

Two firefighters from nearby Steubenville, Ohio, who were at the rally told the AP that they helped people who appeared injured and heard bullets hitting broadcast speakers.

“The bullets rattled around the grandstand, one hit the speaker tower and then chaos broke. We hit the ground and then the police converged into the grandstands, said Chris Takach.

“The first thing I heard is a couple of cracks,” Dave Sullivan said.

Sullivan said he saw one of the speakers get hit and bullets rattling and, “we hit the deck.”

He said once Secret Service and other authorities converged on Trump, he and Takach assisted two people who may have been shot in the grandstand and cleared a path to get them out of the way.

“Just a sad day for America,” Sullivan said.

“After we heard the shots got fired, then the hydraulic line was spraying all around, you could see the hydraulic fluid coming out of it. And then the speaker tower started to fall down,” Sullivan said. “Then we heard another shot that, you could hear, you knew something was, it was bullets. It wasn’t firecrackers.”

“They weren’t super loud shots,” he said.

“You could hear it landing, ammunition landing, on metal,” Takach added.

Then they took cover behind a farm tractor.

Sullivan said they were concerned for Trump and saw him stand up.

“He got up and he gave a motion he was OK,” Sullivan said, raising a fist as Trump had.

The perils of campaigning took on a new urgency after the assassination of Robert F. Kennedy in California in 1968, and again in 1972 in Laurel when Arthur Bremer shot and seriously hurt George Wallace, who was running as an independent on a campaign platform that had sometimes been compared to Trump’s. That led to increased protection of candidates, even as the threats persisted, notably against Jesse Jackson in 1988 and Barack Obama in 2008.

Presidents, particularly after the assassination of John F. Kennedy in 1963, have even greater layers of security. Trump is a rarity as both a former president and a current candidate.

Maryland Gov. Wes Moore, a Democrat, condemned the apparent shooting in a social media post.

“Political violence is never acceptable. Ever. This kind of cowardice must be roundly condemned by all Americans,” Moore wrote. “We have to be a country that can learn to disagree without turning to political violence. I am praying for President Trump’s safety and recovery. Our nation is and must be better than this.”

In another social media post, former Maryland Gov. Larry Hogan offered prayers to Trump and those in attendance.

“Political violence must be universally condemned. America is a tinderbox right now. This must stop,” wrote Hogan, a candidate for U.S. Senate.