ScotRail services in Fife and the rest of Scotland are set to go back to normal after a 5% pay offer was accepted by members of the ASLEF union.
Although the pay offer has been accepted, services aren't expected to immediately return to normal.
But the acceptance will mean that weeks of a temporary timetable due to a driver shortage should end soon.
The rail operator says it'll engage with the union "in the coming days" on the work required to get the full timetable running "as soon as possible", but adds that it's a "complex process".
It will depend on drivers coming back to work rest days and overtime.
ScotRail ASLEF Scottish Organiser, Kevin Lindsay, said: "Following a ballot on the improved offer negotiated with ScotRail, ASLEF members have voted to accept the proposals on pay and conditions.
"ASLEF is a democratic, lay, member-led union, and I want to thank our members for their engagement and response to the ballot."
David Simpson, ScotRail Service Delivery Director, said: "I am delighted that ASLEF members have voted for this pay deal.
"All parties involved have worked hard to find an agreement that recognises the hard work of staff and the financial challenges faced by the railway as we look to recover from the pandemic.
"ScotRail, our staff, and our customers want to have a reliable, efficient, and sustainable railway that supports the economy and connects communities across the country."This deal is a significant step towards delivering that."
Jenny Gilruth, Scotland's Transport Minister and the MSP for Glenrothes, says on Twitter the acceptance of the pay deal is "welcome news" and ScotRail is "working at pace" to implement the full timetable.