Image copyright AP Image caption Briton Michael Sandford "planned to kill Donald Trump", US court papers say

There is renewed focus on US presidential candidates' security after a British man was reported to have tried to grab a US police officer's gun to shoot Donald Trump.

The charge he faces - committing an act of violence in a restricted area - relates specifically to breaches of an area where someone protected by the Secret Service is visiting,

Here, we look at the threats candidates face and their security response.

When did presidential candidates begin receiving protection?

Modern-day levels of presidential protection began in 1963 after John Kennedy's assassination in Dallas. That prompted a major review of security methods.

The protection of presidential candidates was authorised after Robert Kennedy, who was running for president, was assassinated in 1968.

The US government says such protection is designed to maintain the integrity of the democratic process and continuity of government.

How many attempts on the lives of presidential candidates have there been?

Image copyright AP Image caption Edward Kennedy was targeted by a woman with a knife at his Senate office

In 1972, former Alabama governor George Wallace - who campaigned for racial segregation - was shot in Maryland while campaigning for the Democratic presidential nomination.

The gunman, Arthur Bremer, had originally planned to shoot then president Richard Nixon but was put off by the president's security detail. Mr Wallace was left paralysed from the waist down and a secret service officer was also wounded.

In 1979, Edward Kennedy - younger brother of President John Kennedy and Senator Robert Kennedy, who were both assassinated in the 1960s - was the target of a plot by a woman with mental health problems, Suzanne Osgood, who was arrested outside Mr Kennedy's Senate office with a hunting knife.

In addition, plots have been reported against the lives of every US president since Richard Nixon, who took office in 1969.

Dark memories of 1968: James Cook, North America correspondent, BBC News

Image copyright AP Image caption A Trump rally in Ohio in March also saw a security scare

The US presidential election campaign of 2016 has been fringed with violence. Almost everywhere Donald Trump goes he attracts protests.

The tycoon often mocks the demonstrators and there have been clashes with his supporters, both inside and outside of his packed, emotionally charged rallies. For some, the violence has stirred dark memories of 1968 when Democratic presidential contender Robert Kennedy was assassinated and riots broke out at the party's convention in Chicago.

This year events have not descended to those awful depths but still, the country feels edgy and the Secret Service, which guards candidates as well as presidents, has been on high alert.

In March in Ohio agents swarmed around Mr Trump after a man apparently attempted to climb on to the stage where he was speaking. Other events have been cancelled because of security concerns. With five months to go, many Americans are worried about where this election is heading.

What security do presidential candidates get?

Image copyright Reuters Image caption Secret Service agents are assigned to "major" candidates and their spouses

Presidential candidates get Secret Service protection when they become a major-party nominee or beforehand - if they request it or there appears to be a credible threat. This time around, Donald Trump and Ben Carson got protection on the Republican side and Hillary Clinton, who always had it as a presidential spouse, and Bernie Sanders received it on the Democratic side.

They are protected by special agents on temporary assignment from field offices. However, while protection for the president and vice-president is mandatory, others can decline it if they choose.

Measures include securing a location ahead of time and sweeping it with bomb-sniffing dogs, setting up metal detector checkpoints for crowds entering the venue, police-protected motorcades when the candidate travels and 24-hour bodyguards.

The Secret Service says its security operations "deter, minimise and decisively respond to identified threats and vulnerabilities" and draw on specialised resources including airspace security, snipers, counter surveillance and hazardous chemical teams.

However Secret Service agents do not get involved in preventing or dispersing protests unless there is a genuine threat to the candidate, security experts say.

'There was always an agent outside his door' - BBC North America Reporter Anthony Zurcher

Image copyright Getty Images

I was staying down the hall from Mr Trump's hotel room in New Hampshire and there was always an agent outside his door. Whenever he was in the room someone stopped me at the elevator to check my name on the hotel's registry.

Beyond the on-site security, the Secret Service also conducts background checks of people near the candidates and investigates any reports of threats against a protected politician's life.

Write a letter or make a social media post saying you're going to kill the president, and chances are men in dark suits are going to be knocking on your door soon.

What do we know about Donald Trump's security?

Image copyright Getty Images Image caption Secret Service protection is deemed necessary for Mr Trump

Mr Trump has created a privately funded security and intelligence force with a larger remit than the security operations in other campaigns, an investigation by Politico found.

Its duties include finding and ejecting protesters, patrolling campaign events as well as supplementing Secret Service protection for Mr Trump, Politico reported.

Private security firm XMark says on its website that it provided personal security for Mr Trump across the US until last November, when it was relieved by the Secret Service.

Some protesters say they were assaulted by Mr Trump's security team in New York last September.

What do we know about Hillary Clinton's security?

Image copyright Reuters Image caption As a former First Lady, Clinton has long had Secret Service protection

Democratic candidate Hillary Clinton relies on the Secret Service for security and has paid local police departments and security firms to patrol her events, Politico reported.