WASHINGTON (AP) — The Supreme Court ruled Monday that a group of protesters could not bring free-speech claims against two Secret Service agents who were guarding President George W. Bush during a 2004 campaign trip to Oregon.

In a unanimous decision, the justices said the agents did not violate the protesters’ First Amendment rights by moving them farther away from the president while allowing pro-Bush demonstrators to stay nearby.

The protesters claimed the agents moved them only because their loud chants were disturbing Bush’s dinner on an outdoor patio and not for genuine security reasons.

The Obama administration said the actions were proper crowd control tactics and argued that agents who make on-the-spot decisions about the president’s security should be shielded from liability.

Writing for the court, Justice Ruth Bader Ginsburg said no legal precedent would have alerted the agents “that they bear a First Amendment obligation to make sure that groups with conflicting views are at all times in equivalent positions.”

Ginsburg said the protesters’ claims are also undermined by a map of the area, which showed that their location presented a potential security risk to the president while the location of pro-Bush supporters did not. The agents, therefore, had a valid security reason for their actions and are entitled to immunity from private lawsuits, she said.

The dispute began after Bush made an impromptu decision to have dinner at an outdoor patio during a campaign stop in Jacksonville, Oregon. Fifteen minutes into the dinner, secret service agents ordered police to move the anti-Bush protesters two blocks further away from the inn, placing them at a greater distance from the president than the pro-Bush demonstrators.

The agents claimed they did not want anyone “within handgun or explosive in range of the President.” But the anti-Bush protesters argued that they were singled out for expressing their political views. They say the agents’ explanation about security concerns was a pretext because the pro-Bush demonstrators were not moved and other guests of the inn were not screened for weapons or removed.

A federal district court found enough evidence for the case to proceed and the 9th U.S. Circuit Court of Appeals agreed.

(© Copyright 2014 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)