Members of the Scottish Secondary Teachers Association (SSTA) have voted overwhelmingly to accept the latest pay offer from council leaders.
The SSTA and other teaching unions have been engaged in a year-long industrial dispute with councils and the Scottish government.
The pay proposal involves a 7% rise backdated to last April, a further 5% this April and another 2% in January.
The SSTA said members backed the deal in a ballot which closed on Thursday.
Most teachers would see their salaries rise by £5,200 in April if the offer is accepted, according to the Scottish government.