Mr Trump was playing a round at Trump International Golf Course in West Palm Beach when gunshots were heard.Palm Beach County Sheriff Ric Bradshaw told reporters that a Secret Service agent - who was patrolling the course ahead of Mr Trump - spotted a rifle barrel coming out of a perimeter fence.
"He immediately engaged that individual, at which time the individual took off," he said.
It is not yet known whether the suspect fired first or fired a round at all or if only the Secret Service fired.
Follow latest:
Secret Service move Trump to safety after shots heard
A witness spotted the man fleeing the scene in a black Nissan and managed to take photos of the car and number plate.
Ryan Wesley Routh, 58, was arrested after his vehicle was stopped by local police, Sky News's US partner network NBC News reported, citing three senior law enforcement officials.
Officers later searched the area where the man, believed to be Routh, was spotted and found an AK-47-style rifle with a scope, two rucksacks and a GoPro.
Earlier Martin County Sheriff William Snyder described how his officers followed the suspect vehicle for a while before making a "felony stop".
"Our road units picked the vehicle up and we waited a while. We didn't stop him right away. We didn't want a high-speed chase.
"So we were able to wait until we had adequate units, surrounded the vehicle, and forced it to a stop."
He added they managed to take the suspect into custody peacefully.
Read more:
What we know about what happened so far
One person is currently being questioned by local police.
Afterwards, a statement from Mr Trump said: "There were gunshots in my vicinity, but before rumours start spiralling out of control, I wanted you to hear this first: I AM SAFE AND WELL!
"Nothing will slow me down. I will NEVER SURRENDER! I will always love you for supporting me.
"Unity. Peace. Make America Great Again. May God bless you."
Mr Trump has since returned to his Mar-a-Lago resort.
A White House statement said: "The President and Vice President have been briefed about the security incident at the Trump International Golf Course, where former President Trump was golfing.
"They are relieved to know that he is safe. They will be kept regularly updated by their team."
It comes two months after the Republican presidential nominee was shot during an assassination attempt at a rally in Pennsylvania.
The gunman, who was identified as 20-year-old Thomas Matthew Crooks, was shot dead by the Secret Service at the scene.
The attempt on Mr Trump's life led to the resignation of Secret Service director Kimberly Cheatle, who admitted to Congress that her agency had it's "most significant operational failure" in decades.
Ryan Wesley Routh, 58, was identified by three senior law enforcement officials, Sky News's US partner network NBC News reported.
He is believed to be the man shot at by the US Secret Service after gunshots were heard near to where Mr Trump was playing at his Trump International Golf Course in West Palm Beach just after 1.30pm local time on Sunday.
Election latest: Trump 'safe' after 'gunshots in his vicinity'
An AK-47 type assault rifle weapon and a scope, two backpacks and a GoPro device were recovered at the scene, Palm Beach County sheriff Ric Bradshaw said in a news conference.
It comes just nine weeks after the Republican presidential nominee survived another such attempt.
What do we know so far?
Just after 7.30pm UK time, the Trump campaign released a statement to say Mr Trump was "safe following gunshots in his vicinity".
It is believed Mr Trump was taking part in a round at Trump International Golf Course in West Palm Beach at the time the shots were heard.
The FBI later confirmed it was investigating what "appears to be an attempted assassination of former president Trump".
Palm Beach County sheriff Mr Bradshaw said the gunman was about 400 to 500 yards away from Mr Trump and hidden in shrubbery while the former president played golf at a nearby hole.
He said the Secret Service agent - who was patrolling the course ahead of Mr Trump - spotted a rifle barrel coming out of a perimeter fence surrounding the course.
"He immediately engaged that individual, at which time the individual took off," Mr Bradshaw said.
Officials said it remains unclear whether the suspect fired first - or fired at all - or whether only the Secret Service fired.
Police 'surrounded vehicle' of suspect
A witness spotted a man, believed to be Routh, fleeing the scene in a black Nissan SUV and managed to take photos of the car and number plate. Police then alerted the neighbouring Martin County Sheriff's Office which pulled over the vehicle and detained the suspect.
Martin County sheriff William Snyder told reporters his officers followed the suspect vehicle for a while before making a "felony stop".
"Our road units picked the vehicle up and we waited a while. We didn't stop him right away. We didn't want a high-speed chase," he said.
"So we were able to wait until we had adequate units, surrounded the vehicle, and forced it to a stop."
A witness said he saw "20 or more cop cars flying from nearby streets" as he described the emergency response outside Mr Trump's golf course.
"From what I saw, five black unmarked SUVs blocked in a grey Mercedes in front of the golf course," Max Egusquiza told the AP news agency.
"There were about 20 or more cop cars flying from nearby streets," he said.
Suspect had 'calm, flat demeanour'
Mr Snyder told WPTV that Routh was "not armed" when he was taken out of the car.
He said he had a calm, flat demeanour and showed little emotion when he was stopped.
"The suspect did not question why he was being pulled over," Mr Snyder said.
What has Trump said?
Mr Trump was taken back to his Mar-a-Lago resort in Palm Beach after the scare.
He later said in a fundraising email that he was safe.
"There were gunshots in my vicinity, but before rumours start spiralling out of control, I wanted you to hear this first: I AM SAFE AND WELL!" the email said.
"Nothing will slow me down. I will NEVER SURRENDER! I will always love you for supporting me.
"Unity. Peace. Make America Great Again. May God bless you."
Mr Trump's Republican running mate, vice presidential nominee JD Vance, said he will be hugging his children "extra tight" and "saying a prayer of gratitude" after what appears to be an attempt on Mr Trump's life.
"I'm glad President Trump is safe. I spoke to him before the news was public and he was, amazingly, in good spirits," Mr Vance wrote on X.
"Still much we don't know, but I'll be hugging my kids extra tight tonight and saying a prayer of gratitude."
Meanwhile, senator Lindsey Graham, one of Mr Trump's top congressional allies, posted on X to say he is in "good spirits" after speaking with him.
Has the White House responded?
Shortly after details of the "apparent assassination attempt" emerged, the White House said in a statement: "The President and Vice President have been briefed about the security incident at the Trump International Golf Course, where former President Trump was golfing.
"They are relieved to know that he is safe. They will be kept regularly updated by their team."
Kamala Harris, the vice president and Democratic presidential nominee, also said she was "glad" her rival for the presidency was safe after gunshots were heard "in his vicinity".
Writing on X, she said: "Violence has no place in America."
Ms Harris's running mate Tim Walz said he and his wife Gwen were "glad to hear" the former president was safe.
The latest government figures show those who arrived made their journey on Saturday in 14 boats.
It is the second-highest number of arrivals this year. The current record for the highest number of arrivals in one day this year so far is 882 in 15 boats on 18 June.
The deaths occurred after a vessel "tore apart on the rocks" off Ambleteuse in the Pas-de-Calais region of northern France overnight, a regional official said.
Some 51 survivors of the disaster were rescued. Six were taken to hospital, including a 10-month-old baby suffering from hypothermia.
"Driven by profit, human traffickers are putting more and more lives at risk, selling crossings in dangerous conditions on ill-suited boats," the official, Jacques Billant, said. "This is literally leading them to their deaths.
"The boats are overloaded, of poor quality, underinflated, without proper flooring, underpowered, and lack life jackets for all passengers."
Only one in six people on the boat had a life jacket, he added.
It comes as French authorities rescued some 200 people off the coast of Calais over a 24-hour period between Friday and Saturday night.
A boat carrying migrants that was in poor condition was located off the coast of Le Portel, a French coastal town, and 55 people were rescued.
Elsewhere, 61 people were picked up off the coast of La Becque d'Hardelot, 48 people were recovered near a lighthouse and at the end of the day 36 more were rescued, French authorities said.
All of those rescued were brought back to land.
French authorities said they monitored 18 attempts to launch boats across the Channel on Saturday.
Responding to the disaster, Foreign Secretary David Lammy said: "It's awful. It's a further loss of life."
He added that the government has been "discussing how we go after those gangs, in cooperation upstream with other European partners".
Lib Dem deputy leader Daisy Cooper, said it was "desperately, desperately sad" and while her party supports the government's plan to "smash the gangs", they want them to reopen safe and legal routes for asylum seekers.
The Conservatives closed down lots of those routes, which allowed asylum seekers to apply in the UK but from another safe country.
She said: "It would mean they wouldn't have to make that treacherous journey so we hope very much the government succeeds in smashing the gangs.
"But it has to come with both tackling the security element of it and the criminal element of it while making sure we have the right routes for people who have genuine asylum claims."
Steve Valdez-Symonds, Amnesty International UK's refugee and migrant rights director, said: "This is yet another appalling and avoidable tragedy and our hearts go out to the families and friends of those who've died.
"These perilous crossings are seemingly becoming more and more dangerous, suggesting smugglers are taking greater chances with people's lives as they try to evade detection efforts by the UK and French authorities."
He added: "The government's 'smash the gangs' slogan and its security-heavy approach is contributing to the death toll because the refusal to establish safe asylum routes means these flimsy vessels controlled by people smugglers are the only real option for desperate people fleeing persecution."
Mr Valdez-Symonds added: "Until UK ministers and their counterparts in France start sharing responsibility over the need for safe routes, we should expect this weekend's tragedy to keep repeating itself time and time again."
It comes less than two weeks after at least 12 people, including 10 women and girls, died after a boat with dozens of migrants tore apart in the English Channel.
The French coastguard said more than 65 people were rescued after the vessel got into difficulties off the coast of Cap Gris-Nez.
France's interior minister Gerald Darmanin said only eight of the 70 people on board had lifejackets.
It was the deadliest incident so far this year, which had already seen 25 people die attempting to cross the Channel.
At least 45 people have died in Channel crossings so far this year.
More than 21,000 people crossed the English Channel in small boats between January and September this year, government figures show.
Juliana Prosper, 48, was found dead with Kyle Prosper, 16, and Giselle Prosper, 13, in a flat at around 5.30am on Friday.
Police arrested Nicholas Prosper, 18, and charged him with three counts of murder, as well as a number of firearms offences.
A friend of the victim said Juliana Prosper "lived for her children" and said she was "a positive person who will be so terribly missed".
A statement on X, from the headteacher at Lea Manor High School, said they were "deeply shocked" by the death of Giselle Prosper.
"Giselle was a beautiful soul and a model pupil, she excelled in all her subjects and will be sorely missed, particularly by her friends in Year 9.
Kyle Prosper's school described the incident as "devastating" and offered "heartfelt condolences" to his family.
A statement issued by Cardinal Newman Catholic School said: "This is devastating news to all those who knew and loved Kyle and it will take some time to come to terms with the profound sense of loss.
"We know this will be a difficult time for students and staff and we will do all we can to support them with love and compassion.
"We extend our heartfelt condolences to Kyle's family on their immeasurable loss, to his friends and to all those in neighbouring schools who are coming to terms with their own loss."
Detective Superintendent Rob Hall, from the Bedfordshire, Cambridgeshire and Hertfordshire major crime unit, said: "First and foremost our thoughts are with the three people who sadly lost their lives yesterday and their loved ones.
"Although formal identification has yet to take place, next of kin of those who we believe to have died have been informed and are being supported by specialist officers. We would ask that their privacy is respected at this unimaginably difficult time."
DS Hall praised officers involved in the investigation, in particular those who were first at the scene "and were met with such awful circumstances".
He added: "Officers will remain in place at the scene in coming days while we continue our enquiries, and we will also have additional community officers in and around the area to provide reassurance to members of the public at this difficult time."
Prosper has been remanded in custody. He is due to appear at Luton Magistrates' Court on Monday.
More rainfall is expected in the coming days with surging river levels putting authorities on high alert.
Tens of thousands of homes have been damaged so far in Romania, where six people have died, officials said on Sunday, and in the Czech Republic, where thousands were evacuated across the border.
On Sunday, one person was found to have drowned in southwest Poland, a firefighter tackling flooding in Austria also died and four are missing in the Czech Republic.
In eastern Romania's Galati county, where about 5,000 homes were damaged and 25,000 people were left without power, the bodies of three older women and one man were recovered on Saturday.
In some areas, more than 160 litres (42 gallons) of rain fell per square metre.
Romanian President Klaus Iohannis offered his condolences to the victims' families, saying: "We must continue to strengthen our capacity to anticipate extreme weather phenomena.
"We are again dealing with the effects of climate change, which are increasingly present throughout the European continent, with dramatic consequences on people."
Three swept away in car are missing
The north of the Czech Republic bore the brunt of the country's flooding with more than a quarter of a million homes left without power after up to 450mm of rain fell since Wednesday evening, the Czech weather institute said.
But most parts of the country have been affected and the highest flood warning has been issued for around 100 places.
Forecasters said that some parts of the country could see more than a third of their average annual rainfall by the end of the weekend.
Czech police said four people were swept away by the floods, three of them in a car in the northeast of the country, and their whereabouts are unknown.
In Opava, some 10,000 out of a population of 56,000 have been asked to leave their homes. Mayor Tomas Navratil told the Czech public radio it was worse than during the last devastating floods in 1997, known as the "flood of the century".
'Disaster zones'
In neighbouring Austria, 24 villages in the northeast Lower Austria province were declared by authorities to be "disaster zones" and evacuation orders started on Saturday afternoon.
"The coming hours will be the hours of truth for flood protection, for our emergency forces and numerous compatriots," said the province's state governor, Johanna Mikl-Leitner, adding that in one area "we expect challenges of historical dimensions".
Chancellor Karl Nehammer said: "The coming days will still be extremely difficult and challenging for the affected population and the emergency services."
In Vienna, special flood relief channels built in the 1970s and 80s to drain the Danube River are expected to be tested over the weekend.
According to Meteoradar, a significant swathe of land west and southwest of Vienna was due to have around 20cm of rain by the end of Tuesday, with 10-20cm around the Poland-Czech border.
Read more from Sky News:
Children among dead as trains collide
Pope tells US Catholics to choose 'lesser evil'
Ukraine and Russia exchange more than 200 prisoners of war
'Critical night' ahead
In Poland, ahead of the weekend, authorities appealed to people to stock up on food and prepare for power outages.
Prime Minister Donald Tusk said on Sunday that the situation was "dramatic" around the town of Klodzko, where some 25,000 residents live in a valley in the Sudetes mountains near the border with the Czech Republic.
Meanwhile, Glucholazy mayor Paweł Szymkowicz said "we are drowning" as rising waters overflowed a river embankment and flooded streets and houses.
Moldova was also hit and more rain was expected to fall in the coming days too.