President Barack Obama signed the Honoring America's Veterans Act Monday, which will require protestors to stay at least 300 feet away from military funerals.
The new law is meant to restrict controversial demonstrations like those often put on by Westboro Baptist Church at the funerals of homosexual service members.
"We have a moral sacred duty to our men and women in uniform," Obama said before signing the bill. "The graves of our veterans are hallowed grounds."
In addition to the distance rule, the new legislation will prohibit protests two hours before or after a service.
Westboro members have linked the deaths of soldiers to America's growing acceptance of homosexuality.
The family of one gay service member sued after the group protested outside his funeral.
In 2011, the Supreme Court ruled that the Westboro Baptist Church protests are within the freedom of speech and freedom of assembly rights.
The new law also enhances programs to keep vets from homelessness.