CHICAGO – The Chicago Teachers Union’s threat to walk out on students was successful, marking the second time in four years the union has used a teachers strike to pressure city officials into accepting contract terms.

Officials with the CTU and Chicago Public Schools announced a contract agreement after 12 hours of negotiations on Monday, the last day before a scheduled teachers strike set for today, the Chicago Tribune reports.

MORE NEWS: Know These Before Moving From Cyprus To The UK

The tentative deal, which is awaiting approval from union delegates, gives the CTU much of what it wanted in contentious contract talks that have dragged on for nearly two years.

The four year agreement, which is retroactive to the 2015-16 school year, will require the city to continue to contribute 7 percent of teachers’ salaries towards retirement accounts, a massive cost that district officials were working to eliminate. Current employees will be expected to contribute 2 percent toward their retirement, DNAinfo reports.

New employees will be required to pay 9.4 percent of their salaries for retirement, but will receive two 3.5 percent raises in January and July of next year. The deal will also preserve automatic annual step and lane raises, as well as cost of living raises of 2 percent in year three and 2.5 percent in year four of the contract, according to the news site.

“This is not a perfect agreement,” CTU President Karen Lewis said at a press conference. “But it is good for the kids. And good for the clinicians. And good for the teachers, and the paraprofessionals.”

CTU negotiators agreed to increase employee contributions for health insurance by .8 percent, while CPS officials agreed to set aside $7 million to hire more teachers to keep kindergarten through second grade classrooms at a stipulated cap of 32 students.

According to DNAinfo:

In addition, 1,500 teachers will get an incentive to retire early at the end of this school year — an extra $1,500 per year of service to the district. Members of the support staff with 10 years of service will get an extra $750 per year of service if they retire at the end of the year.

The deal also includes a pledge to rehire tenured teachers whose positions are eliminated; requires CPS to consult with the union before privatizing any more nurses positions; and establishes more preparation time for teachers during the school day.

MORE NEWS: How to prepare for face-to-face classes

Chicago Mayor Rahm Emanuel, Chicago Public Schools chief Forrest Claypool and school board president Frank Clark announced the deal shortly after midnight, as parents waited to hear whether teachers were coming to class on Tuesday.

“The teachers’ hard work will be respected in this contract, and appropriately rewarded,” Emanuel said. “Chicago Public Schools’ finances will be stronger and on firmer ground because of this agreement.

“Parents and taxpayers will be relieved, and more importantly, reassured, that we all came together to work together with a common purpose,” he said, according to the Tribune.

The new contract marks the first since an agreement reached amid a teachers strike in 2012 that closed schools for a week and resulted in double-digit raises for CPS employees. The district has been in perpetual financial crisis for years, largely because of expensive union obligations including automatic raises, health insurance costs, retirement contributions, and other CTU perks.