OTTAWA — A day-old strike at Canadian Pacific Railway screeched to an unexpected halt Monday with the company and its union agreeing to binding arbitration just hours before employees were to be legislated back to work.

Labour Minister Kellie Leitch was on the verge of introducing a bill to end the labour dispute when she suddenly emerged from the House of Commons to reveal the two sides had beaten her to it.

Leitch welcomed the sudden willingness by both sides to resume talks through a mediator — a development that had seemed impossible just hours earlier.

"I do believe there are still numerous issues on the table and I'm confident that the mediation and arbitration process will get them to the place where they need to be," she said.

"Our intention is to get service back working at 100 per cent by tomorrow morning."

The strike by 3,300 locomotive engineers and other CP (TSX:CP) train workers began Sunday.

Earlier Monday, as the House of Commons debated the merits of the back-to-work bill, Leitch said the strike could have cost the Canadian economy more than $200 million in lost GDP every week.

Later Monday, the Teamsters Canada union announced on Twitter that the CP strike had ended.

"A mediator will be named," said the tweet. "Details to come."

Earlier, Teamsters union president Douglas Finnson had said he was disappointed by news of a back-to-work bill, calling it "premature and unnecessary."

He said the crucial issues of driver fatigue and working conditions were best settled through negotiations.

Peter Edwards, vice-president of labour relations for CP Rail, said Sunday he supported the government's bill after negotiations failed.