OTTAWA — Lirim Hajrullahu dealt the Calgary Stampeders another stunning Grey Cup defeat.

Hajrullahu's 32-yard field goal with 53 seconds remaining earned the Toronto Argonauts a stunning 27-24 win over Calgary on a snowy Sunday night. It marked the second straight year the Stampeders had posted a CFL-best record during the regular season, only to be upset in the biggest game of the year.

Calgary, which registered a 15-2-1 record in 2016, dropped a stunning 39-33 overtime decision last year to an Ottawa Redblacks team that finished the regular season with an 8-9-1 mark. The Stampeders had a 13-4-1 record this year while Toronto finished atop the East Division at 9-9.

Toronto won its CFL-best 17th Grey Cup, and its first since beating Calgary 35-22 in 2012 at Rogers Centre.

"We got to the fourth quarter, that was our goal — to get to the fourth quarter and be in a competitive game against a really good football team," Argonauts coach Marc Trestman said. "And not that we underestimated ourselves, we thought we could compete with them, but we knew that we needed to keep it close in the fourth.

"We had some luck along the way but we also had some bad luck. We were able to pick up a fumble and run with it and go on for a drive and get some points. Our sideline was business-like, so to speak. It was emotional but it was business-like."

Calgary looked poised to at least force overtime before veteran Matt Black intercepted Bo Levi Mitchell in the end zone with eight seconds left before a TD Place Stadium sellout of 36,154.

"Couldn't finish the deal," Stampeders coach Dave Dickenson said. "It's heartbreaking, it really is. There's nothing I can do about it at this point for our guys. I love 'em, but it's a heartbreaker."

Among those braving the elements were CFL commissioner Randy Ambrosie and Prime Minister Justin Trudeau, who sat together.

Toronto used the big play to earn its first Grey Cup win in five years, which ironically against Calgary at Rogers Centre. The Argos pulled even 24-24 at 10:25 on Cassius Vaughn's 110-yard fumble recovery TD and Declan Cross's two-point convert, stunning the TD Place Stadium sellout of 36,154.

In the first half, Ricky Ray hit DeVier Posey on a Cup-record 100-yard TD strike against a Calgary team that had beaten Toronto eight straight games. Ray set another record by winning his fourth Grey Cup as a starting quarterback.

"That sounds pretty good. Obviously that's for myself to celebrate," Ray said. "I'm just so happy with these guys on this team and what we've been through this year. Man, there's no other way to finish it off than with a Grey Cup. I mean, these guys are such great guys."

Posey, with 102 yards on seven receptions, was named the game's most valuable player.

"That's a great team with a lot of great players and hats off to them, they deserve to be here," Posey said. "But our leader, coach Trestman, he told us that if we can get that team in the fourth quarter, he just believed ... We made a nice backbone for ourselves. We have a lot of experience, we have Ricky Ray, who doesn't want to drive with two minutes left with that guy?"

The white stuff start falling roughly two hours before kickoff, lightly at first before steadily increasing. Toronto running back James Wilder Jr., the CFL's top rookie and a Tampa native, was undeterred as he did pre-game laps on the field shirtless as the game-time temperature was -3 C.

The weather forced the cancellation of the pre-game flyover of two CF-18 Hornets. During each play stoppage stadium employees shovelled the yard lines while two snow plows cleared the hash marks.

At halftime, two full-sized plows helped clear the field prior to country star Shania Twain's performance. The multiple Grammy Award winner arrived on a dog sled before starting her snowy three-song set with "That Don't Impress Me Much," which could've easily been directed towards Toronto's offence in the opening half.

The winter wonderland evoked memories of the '96 Snow Bowl in Hamilton, a game that saw Toronto beat Edmonton 43-37 in blizzard-like conditions. On the second play from scrimmage, Argos' defensive tackle Cleyon Laing did a belly slide after sacking Mitchell.

A play later, Toronto's Armanti Edwards fumbled a punt that teammate Marcus Ball recovered as Calgary handled the snowy conditions much better in surging to a 17-8 half-time lead.

The snow tailed off to start the second half and Toronto, reportedly changing its footwear, responded with an eight-play, 71-yard scoring march capped by Wilder's two-yard TD run and another Cross two-point convert at 4:09 that cut Calgary's lead to 17-16.

But the Stampeders countered with Mitchell's six-yard TD pass to Jerome Messam at 8:56 — following a successful pass interference challenge — to go back ahead 24-16.

Messam, from Brampton, Ont., had two touchdowns and was named the game's most valuable Canadian. Kamar Jorden had Calgary's other touchdown. DaVaris Daniels added a two-point convert while Rene Paredes booted a field goal and convert.

The other Toronto points came on a safety.

Paredes' 39-yard field goal on the final play of the second quarter gave Calgary its 17-8 halftime lead. It came after Juwan Brescacin recovered his own fumble at the Toronto 50-yard line to keep the drive alive.

But Calgary's lead came largely thanks to its CFL-best defence. The unit allowed 135 first-half yards, 100 coming on Ray's Cup-record TD toss to Posey in the second.

Calgary's offence fared better, rushing for 52 yards (5.8-yard average) and 212 offensive yards while holding the ball for 18 minutes.

Toronto pulled to within 14-8 at 9:41 when Calgary punter Rob Maver booted the ball through the end zone following a high snap. Messam's six-yard TD run at 4:52 capped a smart seven-play, 67-yard drive that Daniels finished with a two-point convert, putting the Stampeders ahead 14-6.

Ray's TD pass to Posey 26 seconds into the second tied the score 6-6. That broke the previous mark of '99 yards set by Montreal's Anthony Calvillo and Pat Woodcock in '02. The convert was wide.

Calgary opened the scoring with Mitchell's 33-yard TD strike to Jorden on a third-and-three gamble at 11:28 of the first. The two-point convert was unsuccessful.