OTTAWA - A lockout of about 4,800 Canadian National Railway workers was avoided late Monday when the company and Unifor reached a tentative contract settlement.

The agreement was reached less than an hour after the railway's 11 p.m. ET deadline to lock out mechanical, intermodal and clerical workers.

Negotiations between the two sides had resumed Monday morning with the help of federal mediation advisers and continued beyond the late-night deadline.

Unifor president Jerry Dias told The Canadian Press that the deal “came together when the company realized that the government was not going to interfere.”

“Once the company realized that they had to negotiate an agreement with us, then things fell into place,” he said in a telephone interview.

Dias said federal Labour Minister Kellie Leitch played an important role by telling the two sides they had to negotiate a settlement.

“The company was going to push a lockout and the facts are that the government was not going to interfere,” said Dias.

“We are very pleased that the company and union were able to find common ground on a tentative new labour contract, said CN president and CEO Claude Mongeau in a statement.

“This settlement forecloses the prospect of a potential labour disruption that would have harmed CN's employees, its customers and the Canadian economy.”

The Montreal-based railway had said it planned to lock out the workers unless Unifor agreed to binding arbitration to settle contract differences.

Dias had spoken out firmly against binding arbitration in the belief that CN and Unifor could reach a settlement on their own.

“If we can't find a solution, then shame on us. We don't need somebody else to stick their nose in our business. We should be able to settle it ourselves.”

Unifor said ratification meetings would be held across the country over the next three weeks. It said details of the agreement will only be disclosed after ratification.

Last week, the threat of federal legislation prompted CP Rail and the Teamsters to end a one day strike by 3,300 locomotive engineers and other train workers.