The tree line at the Trump International Golf Club in West Palm Beach, Florida, has been known for years to be a vantage point for photographers looking to catch a candid glimpse of the former president and other VIPs. 

Still, suspected failed assassin Ryan Wesley Routh was able to camp out there for nearly 12 hours Sunday with a rifle aimed at the course, according to a federal affidavit. 

He even brought snacks, prosecutors said.

A Secret Service agent patrolling the perimeter eventually spotted the gunman and opened fire, chasing him off before anyone was hurt. But local authorities say additional perimeter patrols would be an obvious safety upgrade when Donald Trump comes to town.

WOULD-BE TRUMP ASSASSINATION SUSPECT RYAN ROUTH CAMPED UNDER COVER OF DARKNESS FOR 12 HOURS: COURT DOCS

Donald Trump plays golf at the Trump International Golf Club in West Palm Beach

Then-President Trump plays golf at the Trump International Golf Club in West Palm Beach, Fla., on Dec. 30, 2020. (Reuters/Marco Bello)

Trump is known to frequent the course when staying at his Mar-a-Lago resort about 15 minutes away. And even though the visit wasn't on the president's schedule, anyone staking out the area could have been tipped off to his arrival by his motorcade.

TRUMP ASSASSINATION ATTEMPT SUSPECT LAUGHS, SMILES DURING FIRST COURT APPEARANCE IN FLORIDA

WATCH: Palm Beach County State Attorney Dave Aronberg speaks to Fox Digital about a known security concern within Trump's golf course

"There have been previous individuals who have taken pictures of the former president while he's golfing," said Dave Aronberg, the state attorney for the 15th Judicial Circuit, which covers Palm Beach County. "They've gone through the shrubs and been able to poke a camera through the fencing. You would think that perhaps maybe they would consider someone scoping the perimeter."

Donald Trump seen through the bushes playing golf

Then-President Trump plays golf at the Trump International Golf Club in West Palm Beach, Fla., on Dec. 30, 2020. (Reuters/Marco Bello)

Photographers routinely announce their presence to the Secret Service and are well versed in where they can get a good line of sight, the New York Post reported. They are rarely asked to leave, an unnamed photo agency source told the paper.

On the other hand, the source speculated, the threat of running into a photographer may have influenced the suspect's positioning in a remote area of the perimeter that actually had poor sight lines.

Authorities say he never had a chance to lay eyes on the former president, unlike recent failed assassin Thomas Crooks, who opened fire on a crowd, grazing Trump's ear, killing a bystander and wounding two others at a campaign rally in Pennsylvania on July 13.

An exterior view of a gap in vegetation along the perimeter of Trump International Golf Club

This view shows a gap in vegetation along the perimeter of Trump International Golf Club in West Palm Beach, Fla., on Sept. 16, 2024. (Mega for Fox News Digital)

Aronberg said he doesn't blame the Secret Service and noted the course covers a large amount of space between two major highways.

"It's a huge area to cover," he said. "It's not so easy just to keep walking around at all times because someone could slip in and slip out there."

Pat Diaz, a former Miami-Dade homicide detective who is now a private investigator in the region, said a K-9 sweep around the fence line should have been a routine step ahead of the president's arrival, even though it was unscheduled.

TRUMP ASSASSINATION ATTEMPT SUSPECT LAUGHS, SMILES DURING FIRST COURT APPEARANCE IN FLORIDA

"They didn’t check the exterior, clearly," he said.

Ryan W. Routh stands handcuffed after his arrest

Ryan Routh, suspected of attempting to assassinate former President Trump at his West Palm Beach golf course, is shown handcuffed after his arrest during a traffic stop near Palm City, Fla., on Sept. 15, 2024. (Martin County Sheriff's Office/Handout via Reuters)

In addition to photographers, homeless people have also been caught loitering along the fence, he said, welcoming Gov. Ron DeSantis' announcement of another investigation into security at the course at the state level.

WITNESS SAW TRUMP ASSASSINATION SUSPECT FLEE BUSHES, TOOK PHOTO OF GETAWAY CAR

According to the FBI, phone pings show Routh arrived at the tree line around 2 a.m. Sunday and hid there until the agent found him around 1:30 p.m. He allegedly brought a bag of food, a video camera and an SKS rifle with a scope.

The Secret Service did not immediately respond to a request for comment.

Trump International exterior patrolled by law enforcement

Palm Beach County Sheriff’s Department vehicles are seen outside Trump International Golf Club in West Palm Beach, Fla., on Sept. 16, 2024. (Mega for Fox News Digital)

CLICK HERE TO GET THE FOX NEWS APP

Acting Secret Service Director Ronald Rowe praised the agent during a news briefing Monday, telling reporters Trump's security detail conducted a "textbook" response.

"What was critical to this was the quick reaction, the response, the hypervigilance of the men and women of the United States Secret Service, who since July 13th have been rising to meet an unprecedented and hyperdynamic threat environment," he said. "And they are rising to this moment."

An exterior view of a gap in vegetation along the perimeter of Trump International Golf Club

This view shows a gap in vegetation along the perimeter of Trump International Golf Club in West Palm Beach, Fla., on Sept. 16, 2024. (Mega for Fox News Digital)

Trump's whereabouts were "off the record" during his golf outing, and the former president was several hundred yards away at a different hole when the agent opened fire, he said.

An eyewitness provided descriptions of the suspect and his Nissan SUV, which authorities say helped deputies capture Routh about 45 minutes later on Interstate 95.

Routh's criminal history included multiple prior felonies, including a 2002 conviction of possession of a weapon of mass death and destruction after a standoff with police in North Carolina.

The FBI said it received a tip in 2019 that he may be a felon in possession of a firearm.