The Maple Leafs' head coaching search nabbed its top target Wednesday when the team signed former Red Wings bench boss Mike Babcock to a historic eight-year, $50 million contract. But Toronto likely came within hours of settling for the next-best option.

After the Maple Leafs reportedly fell out of favor with Babcock's camp earlier this week, former Lightning coach Guy Boucher was flown to Toronto from Switzerland, where he was coaching in the Swiss National League, for a two-day interview with Leafs executives. Boucher and the Leafs began contract talks Wednesday morning to name him their next coach, according to TVASports.ca.

MORE: Babcock decision a cold reality for Detroit | Best $50 million the Leafs could spend

Then Babcock called.

The TVA report said a Leafs executive left the meeting with Boucher at that time to speak with Babcock, who, according to multiple reports, used a contract offer from the Sabres as leverage for a deal with Toronto, his preferred destination. The Sabres, thinking they had a deal in place with Babcock, were offering amount and term similar to the contract he received with the Leafs.

A #Leafs executive left the meeting w/ Boucher. Worked out a deal w/ Babcock. Boucher came close to becomming head coach. A matter of hours. — Louis Jean (@LouisJean_TVA) May 20, 2015

Hours later, with Boucher waiting in the wings, Babcock agreed to terms with the Leafs. Boucher, who went 97-78-20 in three seasons with the Lightning, was offered an assistant coaching position on Babcock's staff, according to TVA.

Boucher is believed to be interested only in head coaching positions and is unlikely to accept the Leafs' offer. He is considered one of the favorites for the Devils' vacancy.