CN Rail and the Teamsters union say a new tentative agreement has been reached, averting a potential strike by 3,000 workers that could have come as early as this weekend.
CN says details of the tentative three-year contract won't be released until it's ratified by union members.
The union, which represents about 3,000 conductors and yard workers, had previously rejected another tentative deal negotiated last fall.
The federal government had said it was prepared to intervene and force CN workers back on the job if they had gone ahead with a walkout that could have begun as early as Saturday morning.
Labour Minister Kellie Leitch says a strike at Canada's largest railway would hurt farmers and the forestry sector.
Saskatchewan Premier Brad Wall had called on Ottawa to step in before a strike even began.