"We were very anxious to avoid a conflict. It would have caused incredible problems for the general public, who would have found it difficult to get to work and Midsummer celebrations," said Jonas Milton of the Almega employer association.
The agreement signed between Almega and the Seko union will run from April 1st 2013-March 31st 2016 and will ensure salaries rise by 6.8 percent over the period.
The deal also includes an agreement on a new formulation concerning parental leave, including compensation for up to six 30-day periods.
Two joint working groups will also be formed, with one set to review issues concerning threats, violence and working alone. The other will work to improve the integration of the agreement into various areas of operations.
Seko president Janne Ruden told the TT news agency that strike action had looked likely as negotiations remained deadlocked.
"It was only during the afternoon that it began to ease," he said.
Ruden expressed particular satisfaction that the deal can be revoked annually and that a solution has been reached for Seko members working with the Götalandståg rail operator.
"We are very proud that we Seko managed to... protect our members from deteriorating employment conditions when changing train operator," he said in a statement.
"Almega has now taken responsibility for the Swedish model, based on strong collective agreements."
The three-year agreement includes salary increases of 2.7 percent, 1.8 percent and 2.3 percent respectively.
Follow The Local on Twitter