The city will clear school buildings of light fixtures containing PCBs, a carcinogen, by the end of 2016, five years ahead of schedule, under an agreement announced today.

The agreement was struck between the city and New York Communities for Change and New York Lawyers for the Public Interest, which filed suit over the city’s timeline for replacing the toxin-containing light fixtures in July 2011. A mediator stepped in to try to broker a compromise last month.

A year and a half ago, the city said 754 school buildings had the problematic light fixtures, and until recently, officials had said they would clear them all by 2021.

But two weeks ago, after 11 students and a teacher were taken to the hospital after a light fixture containing the chemicals began emitting smoke at a Harlem school, the city announced that it would accelerate the timeline. The announcement also followed a dispute over the light fixtures in a Brooklyn building where a charter school replaced its lights without city permission while schools the district operates continued to have the old fixtures.

“The city’s new timeline for PCB light removal is considerably more reasonable than the previous plan of 10 years,” NYCC member and parent Celia Green said in a statement. “Parents like me will rest easier with the knowledge that at long last the city has made the removal of PCB lights from our kids’ schools a priority.”

City officials had said their capacity to clear schools of PCB lights has been constrained both by money and by the fact that PCB abatement can happen only when schools are not occupied by students. This summer, under the agreement, 200 buildings will be cleared of PCB-containing light fixtures.

“Though this issue has evoked strong sentiments from all involved and was the subject of a major litigation, attorneys from both sides sat down together and, with the assistance of the magistrate judge, engaged in very detailed, productive discussions to find the right solution,” said Michael Cardozo, the city’s top lawyer, in a statement. “This outcome demonstrates the city’s commitment to a smart and beneficial outcome.”

The city had pegged the cost of the 10-year schedule at $1 billion. When the city’s budget is adopted in June, it is likely to reflect the costs of the new timeline, officials said.