By Terry Baynes

(Reuters) - A St. Louis suburb's law that restricts protests around funerals does not violate the free-speech rights of a church known for holding anti-gay demonstrations at military funerals, a federal appeals court ruled on Tuesday.

The 8th U.S. Circuit Court of Appeals upheld the ordinance passed by the city of Manchester, Missouri, to curb picketing at funerals by members of the Westboro Baptist Church of Topeka, Kansas.

Pastor Fred Phelps and other church members have protested at hundreds of funerals of military members killed in Iraq and Afghanistan as part of their religious view that God is punishing America for tolerance of gays and lesbians.

The church has gone to court to defend its right to protest and courts have wrestled with how to balance the group's right to free-speech against individuals' rights to privacy.

In March 2011, the U.S. Supreme Court ruled that the group's funeral protests were protected speech under the First Amendment in a suit brought by Albert Snyder, the father of a Marine who had died in Iraq. The protesters had carried signs that stated, "God Hates You," "You Are Going To Hell" and "Thank God for Dead Soldiers" at his son's funeral.

The 8th Circuit case is the first to be decided since the Supreme Court upheld the group's free speech rights.

Although the church had never held protests in Manchester, two of its members, Shirley Phelps-Roper and Megan Phelps-Roper, sued in 2009 to challenge the city's ordinance, which bars protests within 300 feet of a funeral site within an hour before or after the ceremony. The law imposes a fine of up to $1,000 and up to three months imprisonment.

Both the district court and a three judge panel ruled in favor of the Phelps-Ropers, finding that the court could only shield unwilling listeners outside residential homes. But a larger 8th Circuit panel disagreed.

"The ordinance does not limit speakers or picketers in any manner, apart from a short time and narrow space buffer zone around a funeral or burial service," Judge Diana Murphy wrote for an 11-judge panel.

Anthony Rothert, a lawyer at the American Civil Liberties Union who represented the church members, criticized the court for carving out a new exception to the broad right of free speech on public sidewalks. He said the Supreme Court had previously recognized exceptions outside private residences and abortion clinics.

"Today's decision creates a new exception for funerals. We don't think that's justified by the First Amendment," Rothert said. He said the church members had not yet decided whether to appeal, but the issue would likely come before the Supreme Court again. The church is challenging several other laws, including statutes in Missouri and Nebraska.

A lawyer for Manchester did not immediately respond to a request for comment.

The case is Phelps-Roper et al v. City of Manchester, Missouri, U.S. Court of Appeals for the 8th Circuit, No. 10-3197.

(Editing by David Brunnstrom)