By Lawrence Hurley

WASHINGTON (Reuters) - The Supreme Court ruled on Wednesday that an anti-nuclear weapons protester could not avoid prosecution simply because he demonstrated on a public road that runs through a U.S. military installation in California.

On a 9-0 vote, the court found fault with a federal appeals court decision that said the protester, John Apel, was immune from prosecution because he had been demonstrating on the road crossing the Vandenberg Air Force Base.

The court did not rule on Apel's claim that his free speech rights under the First Amendment of the Constitution were violated by the prosecution. He can raise those objections again in lower courts.

Apel was convicted in 2010 on three counts of trespassing on the base.

The U.S. government had asked the justices to overturn the appeals court ruling on the grounds that the road is on government-owned land and under the control of the base commander.

The law under which Apel was prosecuted prevents people from re-entering military bases after they are barred. Apel had been barred from the base but continued to attend anti-nuclear weapon demonstrations there.

Writing for the court, Chief Justice John Roberts said there was nothing to suggest the military did not have authority over the land "merely because the government has conveyed a limited right to travel through a portion of the base or to assemble in a particular area."

In a concurring opinion, Justice Ruth Bader Ginsburg, joined by Justice Sonia Sotomayor, indicated that Apel may have better luck with his First Amendment claim.

She said it was "questionable whether Apel's ouster from the protest area can withstand constitutional review."

In its April 2012 ruling, the 9th U.S. Court of Appeals in San Francisco said the government did not have an exclusive right of possession over the area where the alleged trespass took place.

The case is U.S. v. Apel, U.S. Supreme Court, No. 12-1038.

(Reporting by Lawrence Hurley; Editing by Howard Goller)