The Supreme Court on Monday unanimously ruled against a protester who said his free speech rights had been violated when Secret Service agents arrested him after he made critical remarks about the Bush administration's war policies.

The case arose from a 2006 visit by Vice President Dick Cheney to a mall in Beaver Creek, Colo. A Secret Service agent assigned to protect the vice president said he heard a man standing nearby say into a cellphone that he planned to ask Mr. Cheney "how many kids he's killed today." The man, Steven Howards, later approached Mr. Cheney and said the administration's "policies in Iraq are disgusting."

Mr. Howards also touched Mr. Cheney on the shoulder. Mr. Howards said the gesture was an openhanded pat. Secret Service agents described it as a forceful push. Writing for the court, Justice Clarence Thomas said the dispute over the manner of the touch "does not affect our analysis."

One agent, Virgil D. Reichle, later confronted Mr. Howards and asked him if he had assaulted the vice president. Mr. Howards falsely denied having touched Mr. Cheney and said, "If you don't want other people sharing their opinions, you should have him avoid public places."

Mr. Reichle arrested Mr. Howards for assault and turned him over to the local authorities. He was charged with harassment under state law, but those charges were dropped.

Mr. Howards sued, saying the arrest had violated his First Amendment rights. A divided three-judge panel of the United States Court of Appeals for the 10th Circuit allowed the case to proceed.

Mr. Howards's false statement about not touching Mr. Cheney was reason enough to arrest him under the Fourth Amendment, the appeals court said. But it added that his First Amendment rights might have been violated since his remarks could have "substantially motivated" agents to take action against him.

The Supreme Court reversed the decision, saying the Secret Service agents could not be sued. They were entitled, Justice Thomas wrote, to the qualified immunity available to government officials when the legal principle said to bar their conduct was not "clearly established." The court did not decide whether the First Amendment in fact allows retaliatory arrests in such circumstances.

"This court," Justice Thomas wrote for six justices, "has never recognized a First Amendment right to be free from a retaliatory arrest that is supported by probable cause; nor was such a right otherwise clearly established at the time of Howards's arrest."

Two months before the encounter at the mall, the Supreme Court ruled in Hartman v. Moore that government officials could not be sued under the First Amendment for retaliatory prosecutions where there was probable cause to pursue the prosecution. "A reasonable official," Justice Thomas wrote on Monday, "also could have interpreted Hartman's rationale to apply to retaliatory arrests."

That meant the law at the time of the encounter was not "clearly established," Justice Thomas said. He added, though, that "we do not suggest that Hartman's rule" concerning retaliatory prosecutions "in fact extends to arrests."

Justice Ruth Bader Ginsburg, joined by Justice Stephen G. Breyer, voted with the majority in the case, Reichle v. Howards, No. 11-262, but did not adopt the majority's reasoning. In general, she wrote, suits against "ordinary law enforcement officials" over retaliatory arrests should not be barred by the Hartman decision.

But Secret Service agents are different, Justice Ginsburg wrote.

"Officers assigned to protect public officials must make singularly swift, on the spot, decisions whether the safety of the person they are guarding is in jeopardy," she wrote. "In performing that protective function, they rightly take into account words spoken to, or in the proximity of, the person whose safety is their charge."

Justice Elena Kagan did not participate in the decision, presumably because she had worked on the case as United States solicitor general.