Robert Weiler Jr., a fervent anti-abortion protester, in a portrait outside the construction site of the new Planned Parenthood which is adjacent to the Two Rivers Public Charter School, shown on March 10, 2016. (Evelyn Hockstein/For The Washington Post)

An anti-abortion activist who served five years in federal prison for plotting to blow up an abortion clinic has agreed to limit his protest activity outside a prominent Washington, D.C., charter school that is next to a Planned Parenthood clinic.

Robert Weiler Jr., of Middle River, Md., accepted the terms of an injunction submitted for approval to the Superior Court of the District of Columbia that restricts what he can say and do near the Two Rivers Public Charter School in Northeast. The school filed a lawsuit in December seeking to stop Weiler and four other abortion opponents from interacting with students and parents who were going to and from the school.

The lawsuit charged that Weiler and other abortion opponents harassed students and parents by holding up images of aborted fetuses and signs saying the Planned Parenthood clinic is a “murder facility.” The school alleged that protesters yelled at children, including saying: “They are going to murder kids right next door if your parents don’t do something about it.”

The clinic, then under construction, is expected to open in September.

Weiler and several of the other defendants filed motions to have the lawsuit dismissed, arguing that the school was trying to prevent them from exercising their First Amendment right to free speech.

The permanent injunction agreed to by Weiler, but not yet approved by D.C. Superior Court Judge Jeanette J. Clark, would prohibit him from entering the school’s premises or blocking any access to the school. It also establishes a perimeter around the school within which Weiler may not protest during certain hours.

In addition, the agreement prohibits Weiler from using posters or displays larger than 11 inches by 17 inches “depicting gruesome images of mutilated body parts or dead bodies in a manner reasonably likely to be viewed by children under twelve years of age attending school at Two Rivers’ elementary school or middle school buildings” or using such violent terms as “kill” and “murder.”

Michael Murphy, an attorney representing Two Rivers, said Wednesday that the injunction “creates a safe route for kids to come and go from school without having to dodge protesters.”

Weiler said he agreed to the order because he didn’t have plans to return to protest at the school and didn’t want to spend the time and money necessary to fight the lawsuit.

“For me, it’s not worth pushing the issue right now,” Weiler said Wednesday. “I think the school is going to lose the lawsuit. But the other people have pro bono lawyers, so I’m going to let them fight the fight.”

Weiler was arrested in June 2006 for plotting to blow up the Metropolitan Family Planning Institute in Greenbelt, Md. He had constructed a pipe bomb that he intended to plant at the clinic. His parents learned about the plot from one of his friends and alerted Prince George’s County police. Weiler was arrested with a loaded pistol in his car and told investigators that he planned to use the gun to shoot doctors who perform abortions.

At his first court hearing following his arrest, Weiler wore a T-shirt with the words “Help Cure Abortion” on the front and “ABORTION: The leading cause of death in America” on the back.

So far, Weiler is the only one of the defendants in the lawsuit who has agreed to the injunction. A trial in the case is expected to begin next year.