After three days of picketing and an all-night bargaining session, the Denver Classroom Teachers Union (DCTA) and Denver Public Schools (DPS) reached a tentative agreement Thursday morning to end the district’s first strike in 25 years, which began Monday morning. At approximately 6 a.m. on Thursday, after nearly 20 hours of negotiating, DPS Superintendent Susana Cordova and DCTA’s president Henry Roman signed an agreement and hugged, according to reporters who spent the night following negotiations in the basement of the Denver Central Library.

The new agreement revises the DPS salary structure so that teachers can use traditional “steps” and “lanes” to increase their pay rather than the opaque structure that was in place with the controversial Professional Compensation (ProComp) system. The agreement also raises the starting salary for DPS teachers to $45,800 annually and allows the most senior teachers to earn up to $100,000; DPS teachers will also receive an average base salary increase of 11.7 percent next year. Teachers who serve in “high priority” (hard-to-staff and low income) schools will continue to receive a bonus—which was one of the district’s priorities—if research proves that such incentives actually increase teacher retention.

While this technically ends the strike, it was not immediately clear how many teachers would return to the classroom on Thursday, as the agreement was struck only hours before the school day began. The new agreement also must be ratified by members of the union and by the Denver Board of Education. It’s unclear when those votes will take place, but the union teachers are expected vote in favor of the agreement, a spokesperson said.

“This agreement is a win, plain and simple,” Roman said in an emailed statement. “For our students; for our educators; and for our communities.”

The new agreement ends a 15-month negotiation process and a contentious several weeks in which union leaders and district officials sparred over the DPS compensation structure. The ProComp system expired on January 18, which is why the two parties were at the bargaining table in the first place. The past month featured a series of dramatic negotiation sessions, which only intensified after Gov. Jared Polis announced the state would not help mediate the dispute. DCTA officials walked away from the negotiating table several times—most notably on Saturday, February 9, just two days before the strike began. The district and union reconvened on Tuesday, February 12 and bargained continuously until an agreement was reached Thursday.

Shortly after the agreement was signed, Cordova told reporters she was happy with the collaboration between the district and union. “There was a recognition that we share many areas of agreement,” she told the Denver Post. “And we worked hard to listen and find common ground on the few areas where we had different perspectives.”

Once ratified, the agreement will go into effect beginning in the 2019—20 school year.