Law enforcement personnel investigate the area around Trump International Golf Club after an apparent assassination attempt of former President Donald Trump on September 15, 2024 in West Palm Beach, Florida. The FBI and U.S. Secret Service, along with the Palm Beach County Sheriff's office, are investigating the incident, which the FBI said "appears to be an attempted assassination of former President Trump" while he was golfing at the course. (Photo by Joe Raedle/Getty Images)

(PALM BEACH, Fla.) -- Former President Donald Trump thanked law enforcement for an "incredible" response to what the FBI described as an assassination attempt at Trump's Palm Beach, Florida, golf course on Sunday.

Multiple law enforcement sources told ABC News that 58-year-old Ryan Wesley Routh was detained by Florida authorities in relation to the incident. Authorities are now probing for more details on the would-be shooter.

"I would like to thank everyone for your concern and well wishes - It was certainly an interesting day!," Trump said in a post on Truth Social.

"Most importantly, I want to thank the U.S. Secret Service, Sheriff Ric Bradshaw and his Office of brave and dedicated Patriots, and, all of Law Enforcement, for the incredible job done today at Trump International in keeping me, as the 45th President of the United States, and the Republican Nominee in the upcoming Presidential Election, SAFE."

"THE JOB DONE WAS ABSOLUTELY OUTSTANDING. I AM VERY PROUD TO BE AN AMERICAN!" he wrote.

Secret Service agents accompanying Trump fired at a man armed with an AK-47-style rifle on or near the Trump International golf course on Sunday.

The incident comes around two months after Trump was shot in the ear at a campaign rally in Butler, Pennsylvania.

The FBI is investigating Sunday's incident as an "attempted assassination." Palm Beach County Sheriff Ric Bradshaw said at a news conference Sunday afternoon that the gunman was within 300 to 500 yards of Trump when he was spotted.

Secret Service agents fired four to six rounds at him before he dropped his weapon and fled the scene in a vehicle. Witnesses reported the license plate number to authorities, and the suspect was stopped and detained.

It was not clear if the suspect was aiming his gun at the former president. Agents fired at the suspect after spotting his rifle through the fence line, multiple sources told ABC News.

Sources said three shell casings believed to be associated with the suspect's AK-47 were found on the scene, though investigators are still evaluating whether the suspect fired his weapon. The rifle and two backpacks containing a GoPro camera and ceramic tiles were recovered from the scene, Bradshaw said.

Sources said Trump was immediately rushed to a safe area on the grounds of the golf course after the shots were fired.

Authorities are now probing Routh's background. The detainee is believed to have ties to North Carolina and Hawaii, sources said. Sources told ABC News that the FBI is conducting an extensive investigation into Routh's social media activity, travel and any criminal record. Friends, family and associates are also being sought for interviews.

Sources familiar with the investigation said authorities are looking into whether Routh had grievances related to Trump's position on Ukraine.

Authorities are expected to file charges relating to the incident in the coming days, sources told ABC News.

President Joe Biden and Vice President Kamala Harris both condemned the apparent assassination effort.

"As I have said many times, there is no place for political violence or for any violence ever in our country, and I have directed my team to continue to ensure that Secret Service has every resource, capability and protective measure necessary to ensure the former President's continued safety," Biden said in a statement.

Harris said she was "thankful" that Trump was safe and "deeply disturbed by the possible assassination attempt."

"As we gather the facts, I will be clear: I condemn political violence. We all must do our part to ensure that this incident does not lead to more violence," Harris said.

ABC News' Lalee Ibassa, Katherine Faulders, Aaron Katersky, Soo Rin Kim, Michelle Stoddart, Pierre Thomas, Rachel Scott, Jack Date, Leah Sarnoff, Kelsey Walsh and Luke Barr contributed to this report.

Copyright © 2024, ABC Audio. All rights reserved.