Mayor Bill de Blasio announced that New York City and the teachers union have agreed to a "landmark" nine-year contract, which includes back pay for the union.

The United Federation of Teachers has been without a contract for the past five years, and it looks like there will finally be one after a weeklong effort to hammer out a deal spearheaded by de Blasio, reports The New York Times. The deal still needs to be ratified by 100,000 members of the union.

The agreement will give the union $3.4 billion in back pay in return for revised classroom rules and health care cost savings. According to The Wall Street Journal, the reduction in health care costs could save the city over $1 billion spread across the nine years.

UFT members will also see a small pay increase during the life of the new contract. For the first three years of the deal, which will retroactively start in May 2013, members will see a 1 percent pay increase, followed by a 1.5 pay increase in 2016. A 2.5 percent pay increase will follow in 2017 and members will then see a 3 percent increase in May 2018.

The city also agreed to honor a 4 percent raise the previous administration promised. The raise won't come right away, but similar to the other pay increase, will be done incrementally, starting in 2015 through to 2020.

The new contract also will include new steps in dealing with under-performing teachers that are considered part of the "absent teacher reserve" pool and will allow officials to more effectively let those teachers go, helping to keep better teachers.