The school district and teachers reached an agreement following an all nighter Monday night.

The teachers were poised to strike, but this last minute agreement avoids that.

Christine Miles is the spokeswoman for the Portland School District. She says both sides really wanted to avoid the pain of a walkout.

"When both sides, the school district and the union are willing to work, there's going to be a positive outcome. There were heated moments. It was emotional and tiring. But both sides were focused on getting a deal done and they did that."

The settlement followed ten months of negotiations and prevents a strike at the state's largest district with its nearly 50 thousand students.