OTTAWA — Ricky Ray earned a record-setting Grey Cup win while handing the Calgary Stampeders another stunning defeat.

Lirim Hajrullahu’s 32-yard field goal with 53 seconds remaining earned the Toronto Argonauts a stunning 27-24 victory over Calgary on a snowy Sunday night. That secured Ray a fourth CFL title as a starting quarterback, the most in league history.

"That sounds pretty good," said Ray. "Obviously that’s for myself to celebrate.

"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."

Ray finished 19-of-32 passing for 297 yards with a touchdown, which came on a record-breaking 100-yard, first-half completion to DeVier Posey. That earned Posey, who finished with seven receptions for 175 yards, MVP honours.

It certainly was a magical ending for an Argos team coming off a dismal 5-13 record last season. It wasn’t until February that Toronto hired the former Montreal tandem of Jim Popp and Marc Trestman as GM and head coach.

"We have a locker-room full of guys who can beat adversity," Posey said. "We fought adversity all year."

And the same applies for Ray, who made 17 regular-season starts in his first year under Trestman after injuries the previous two years limited him to just 12 appearances combined.

"It’s unbelievable, man," Ray said. "It just caps off an awesome year.

"It just showed the grit of this team to just keep fighting all the way to the end. What an unbelievable year."

Calgary’s Jerome Messam, a native of Brampton, Ont., was the game’s top Canadian. Messam ran for 62 yards and a TD on 13 carries while adding a six-yard touchdown reception.

Now Toronto fans will begin an anxious off-season waiting to learn of Ray’s future. The 38-year-old is scheduled to become a free agent in February, and last year Henry Burris retired shortly after leading Ottawa to another stunning Grey Cup win over Calgary.

"Man, I don’t know," Ray said. "This one just feels so good right now, we’ll see what happens."

It was yet another heartbreaking end to an otherwise stellar season for Calgary. The club was 15-2-1 in 2016 only to drop a stunning 39-33 overtime Grey Cup loss to an Ottawa team that finished atop the East Division at 8-9-1 mark.

Calgary followed up this year with a 13-4-1 regular-season mark before losing to a Toronto squad that finished first in the East at 9-9. What’s more, the Stampeders came into the Grey Cup riding an eight-game win streak versus the Argos.

"Everyone said they (Stamps) were going to win and this was going to be a redemption year," said Argos defensive back Cassius Vaughn, who set a CFL record by recovering a fumble and returning it 110-yards for a touchdown that tied the game at 24-24. "During media day, (reporters) were acting like do we have a chance, we were supposed to be here?

"Hell yeah, we’re supposed to be here. They weren’t better than us, we worked just as hard."

Calgary’s offence rolled up 447 total yards and held the ball for almost 37 minutes. Mitchell finished 33-of-45 passing for 373 yards and two TDs and interception. Kamer Jordan had six catches for 117 yards and a touchdown while DaVaris Daniels added 11 receptions for 113 yards.

But Jorden also committed the fumble that Vaughn returned for the pivotal game-tying TD.

"It’s a stupid play (to) be real," veteran Stamps receiver Marquay McDaniel said of Jorden’s miscue. "We talked all game about putting two hands on the ball.

"Stupid football killed us. It was a dumb play, it changed the whole game."

Toronto won its CFL-best 17th Grey Cup but first since beating Calgary 35-22 in the 100th CFL title game at Rogers Centre in 2012.

Calgary looked poised to at least force overtime before veteran Matt Black — released earlier this year, then re-signed by Toronto — intercepted Bo Levi Mitchell in the end zone with eight seconds left. It capped a wild finish for a TD Place Stadium sellout of 36,154 that included CFL commissioner Randy Ambrosie and Prime Minister Justin Trudeau braving the wintry conditions together.

"Couldn’t finish the deal," said Calgary head coach Dave Dickenson. "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."

Toronto rode two big plays to victory, Vaughn’s fumble recovery and Ray and Posey combining on their record-setting touchdown in the opening half.

"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," Toronto head coach Marc Trestman said. "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."

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.

Toronto managed just 128 first-half yards, meaning the unit had just 28 yards after the Ray-Posey completion. Calgary fared much better in the snow, rushing for 52 yards (5.8-yard average) and 212 offensive yards while holding the ball for 18 minutes.

But Ray said many Argos changed shoes at halftime because of the weather, although he wasn’t one of them.

"I tried some different stuff on at halftime," he said. "I really wasn’t having trouble with my footwear so I stuck with what I had but a lot of guys switched."

The move helped as Toronto’s offence accumulated 188 second-half yards and the Argos outscored Calgary 19-7. But Ray also said head coach Marc Trestman’s half-time advice was very useful.

"Just calming us down," Ray said. "Coach talked about just executing the play, not worrying about anything else and that’s what we did in the second 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 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 Calgary’s successful pass interference challenge — to go back ahead 24-16.