A ballot of members of the Educational Institute of Scotland (EIS) saw 90% voting to accept the deal, which will give pay increases of 1% this year and next year.
The deal also includes improvements to the pay and conditions of short-term supply teachers, whose numbers have been dropping in recent years after a pay cut.
There will also be salary protection for former chartered teachers and some protection from administrative duties for teachers.
The package also includes commitments on maintaining teacher numbers in Scottish schools and addressing excessive teacher workload.
Larry Flanagan, general secretary of the EIS, welcomed the settlement, but said the unions would be looking for greater pay rises in future.
He said: "Teachers have recognised the positive elements of this hard-won package.
"However, the pay element of the package falls far short of being a fair settlement and the EIS is clear this continuing attack on living standards cannot be allowed to continue."
Michael Russell, the Education Secretary, also welcomed the decision.
He said: "I very much welcome this important step in concluding the current negotiations on teachers' pay and conditions.
"These negotiations have taken time, but I look forward to their resolution so that teachers can receive their pay increase as soon as possible."
Billy Hendry, human resources spokesman for local authority umbrella body Cosla, added: "We welcome the overwhelming acceptance of this pay deal for teachers and the certainty this gives for industrial relations."