A federal judge has upheld a Missouri law requiring protesters to stay at least a football-field length away from funeral sites, beginning an hour before they start until an hour after the services end.

The ruling by U.S. District Judge Fernando Gaitan Jr. caps a nearly eight-year legal fight over Missouri's funeral protest restrictions that were prompted after members of a Kansas church opposed to homosexuality protested at the funeral of a Missouri solider who had been killed in Iraq.

Missouri Attorney General Chris Koster said the law is now in effect.

"No parent who has lost a child should be confronted by the hate and intolerance of strangers, and today's ruling means parents and other loved ones will have a protective boundary from protesters," Koster said Tuesday in a written statement.

Gaitan's ruling was dated Monday.

Many police and sheriffs already had been enforcing the law after the 8th U.S. Circuit Court of Appeals issued a mixed ruling on it last April, said Anthony Rothert, an attorney for the American Civil Liberties Union.

Rothert's client in the case was Shirley Phelps-Roper, a member of the Topeka, Kan.-based Westboro Baptist Church, which conducts protests at funerals to highlight its belief that God is punishing the U.S. for its acceptance of homosexuality, regardless of whether the deceased person was gay.

After Westboro members protested at a 2005 funeral in Missouri, the state Legislature responded in 2006 by passing a general prohibition against protests and pickets near funerals from one hour before they start until an hour after they end. Concerned about potential legal challenges, Missouri lawmakers a few months later passed a second law containing a specific 300-foot buffer zone but included wording making it effective only if the more general prohibition was invalidated in court.

Both laws contained the same penalty for protesters - up to six months in jail and a $500 fine for a first offense, and up to one year in jail and a $1,000 fine for repeat offenders.

The 8th Circuit appeals court last April struck down the general prohibition as an unconstitutional infringement on free speech. It upheld the 300-foot buffer around funeral sites, but not around funeral processions, and sent the case back to Gaitan for further proceedings.

Phelps-Roper had argued that the one-hour restriction associated with the 300-foot buffer was unconstitutionally vague because it's difficult to know exactly when funerals begin. But Gaitan rejected that assertion, saying there was no evidence that funerals frequently start earlier than their published times.

Rothert said Westboro members have adjusted to the Missouri law by keeping their distance from funeral sites long before the one-hour requirement kicks in.

"They've been able to err on the side of caution and stay 300 feet away all the time, so the time factor has not been a problem," he said.