US Secret Service agents opened fire after seeing a person with a firearm near former president Donald Trump’s golf club in West Palm Beach, Florida, according to law enforcement officials.

The Republican presidential candidate is safe, his campaign team confirmed.

The person fled in an SUV and was later apprehended in a nearby county by local law enforcement, the officials said.

The officials were not authorised to discuss the matter publicly and spoke on condition of anonymity about an ongoing investigation.

An AK-style firearm was recovered at the scene near Mr Trump’s golf course, one of the officials said.

The golf course was partially shut down for Mr Trump as he played, and agents were a few holes ahead of him when they noticed the person with the firearm, the officials said.

The person appeared to push the muzzle of the rifle through the fence line and that is when agents fired, the officials said.

Mr Trump’s campaign and the Secret Service said he was safe, and the agency said it was investigating the incident that occurred shortly before 2pm local time.

The incident comes two months after Mr Trump was shot during an assassination attempt at a rally in Pennsylvania, and a bullet grazed his ear.

Mr Trump had returned to Florida this weekend from a West Coast tour that included a Friday night rally in Las Vegas and a Utah fundraiser.

No injuries were reported, according to a spokesperson for the Palm Beach County Sheriff’s Office in Florida.

The White House said President Joe Biden and Vice President Kamala Harris, the Democratic presidential nominee, had both been briefed and would be kept updated on the investigation.

The White House added they were “relieved” to know Mr Trump is safe.

Ms Harris, in a statement said she was “glad” Mr Trump was safe, adding that “violence has no place in America”.