An accord to avert the stoppage at the state-run RENFE rail network was reached late Monday in talks between union and government officials.
The strike would have come just days after a three-day stoppage by pilots at the Spanish airline Iberia and meant more headaches for travelers in the middle of the vacation season.
The train drivers union, known as SEMAF, wanted more training hours for new drivers. They said they wanted more safeguards in place, anticipating that companies entering the sector after Renfe's monopoly ends in the coming years would seek to train drivers as fast as possible.
Under new rules that were to have taken effect in August, drivers of passenger and freight trains would have had to undergo 800 hours of training; the unions wanted 2,100 hours. In the end the two sides settled on 1,150 hours, SEMAF said.
The government also agreed to more training hours for drivers of maintenance trains and other rail equipment that does not transport people or cargo, increasing the hours of instruction from 300 to 425, the AP reports.
The United States has imposed new sanctions against the Nord Stream 2 gas pipeline project, which still remains under construction