A Southern California man who urged readers of an online message board to "shoot the n-" two weeks before the 2008 presidential election, and said Barack Obama "will have a 50 cal in the head soon," was protected by freedom of speech, a federal appeals court ruled Tuesday.

In a 2-1 decision, the Ninth U.S. Circuit Court of Appeals in San Francisco overturned Walter Bagdasarian's two felony convictions for threatening to kill a presidential candidate and said his advocacy of violence, though "alarming and dangerous," was not illegal.

The online posting "conveys no explicit or implicit threat on the part of Bagdasarian that he himself will kill or injure Obama," said Judge Stephen Reinhardt in the majority opinion. The law, he said, "does not criminalize predictions or exhortations to others to injure or kill the president," or a candidate.

Dissenting Judge Kim Wardlaw said anyone posting such messages "at a time when violent and racist threats against candidate Obama were being taken very seriously" must have known, and intended, that they would be interpreted as threats.

Lawyers for Bagdasarian and the U.S. attorney's office in San Diego declined to comment on the ruling.

Prosecutors could ask the full appeals court for a rehearing or appeal to the U.S. Supreme Court.

Eugene Volokh, a UCLA law professor and legal commentator, said the high court might well decide to review the case.

"This is a close case," he said. "The line between punishable threats and protected vituperation, or even protected advocacy of violence, is not completely clear."

Bagdasarian, of La Mesa in San Diego County, posted the statements under the pseudonym "californiaradial"on a Yahoo Finance message board in October 2008. On election day two weeks later, the court said, he sent e-mails with a link to an ad for a rifle, a video of cars being blown up, and racist references to Obama.

Secret Service agents went to his home several weeks later and found six guns, including a .50-caliber rifle, the court said.

Bagdasarian waived his right to a jury trial and was convicted by a federal judge in July 2009. After apologizing and saying he had posted the initial messages while drunk, he was sentenced to two months in a halfway house, in addition to 24 days he had already spent in jail.

In Tuesday's ruling, Reinhardt, joined by Chief Judge Alex Kozinski, said the Supreme Court had made it clear in 2003 that violent statements are protected by free speech unless the speaker intended to carry out an unlawful assault, or at least to threaten an assault.

Bagdasarian may have believed he was encouraging others to kill Obama, Reinhardt said, but his words - even read alongside his possession of guns - expressed no intent to take such actions himself.

But Wardlaw said such messages - in a time of fear, racial tension and outbreaks of violence - would be interpreted by most people, including the Secret Service agents protecting Obama, as threats of harm.

The ruling can be viewed at www.ca9.uscourts.gov/datastore/opinions/2011/07/19/09-50529.pdf.