Did Wake Forest give this football game away, or did Duke take it? Depends who you ask.

Duke will say it won this one with grit and determination, finding a way against all odds, especially at the very end.

Wake Forest will say it gave it all away, gift-wrapped with a bow on it, handed over with a series of improbable errors both mental and physical.

Oh, they’re both right.

What Thursday night’s game lacked in execution at times — or, for that matter, attendance on a frigid evening in Durham as two teams tried to salvage seasons that were heading in the wrong directions — it more than made up in wild swings of momentum and late drama.

Wake Forest had the ball, at midfield, with fewer than five minutes to play, driving on a weary Duke defense, as it had for most of the night.

And lost.

How that came about, with Duke down to its third-string quarterback, with its best receiver suddenly unable to catch even the most unimpeded throws, is a story of both dogged resilience and complete and total collapse.

It just depends who you ask.

Wake Forest gave it away, to be sure.

But Duke, almost despite itself, proved willing and able to accept the gift.

The Blue Devils are bowl-eligible again, for the second straight year under Mike Elko, after Todd Pelino’s 26-yard walk-off field goal gave them a 24-21 win, bouncing back from losses at Florida State and Louisville. Their slim hopes of making it to the ACC title game remain alive despite … everything.

No Riley Leonard, again, now out for an extended period with an injury to his other leg. Missing its two best offensive linemen, Graham Barton and Jacob Monk. Jalon Calhoun had a bad case of the drops. Wake Forest outgained Duke 400-267 on the night, and Mitch Griffis threw only three incompletions, but the third flipped the game upside-down.

With the ball in Duke territory and a little more than four minutes to go, all the Demon Deacons had to do was get in position for a game-winning field goal and grind out the clock. But on first-and-10 from the Duke 40, Griffis dropped back to throw and, unpressured, threw a wounded duck that slipped out of his hand and fluttered into the surprised arms of Duke’s Ryan Smith.

Even then, Wake Forest was still in position to get the ball back as Duke went backward, but Deshawn Jones tackled Jordan Moore on 3rd-and-14, never looking back for the ball, obvious pass interference. Given new life, Duke crossed midfield and completed a pass to the 30-yard line, where Jones, again, body-slammed Sahmir Hagans to the ground. Immediate flag, and go directly to field-goal range, without passing go.

Griffis may have coughed it up, but Jones taking 25 yards in penalties in five plays made it a team effort. Offense and defense. Throw in special teams while you’re at it — Matthew Dennis missed a pair of field goals, one after a bad Loftis interception in the shadow of his own end zone — but Wake had managed to overcome all of that to put itself in a position to win.

And then put Duke in a position to win instead.

What an extraordinarily improbable sequence of events. A quarterback just flubbing a throw. The same player taking two penalties. A game all but won, lost. You couldn’t make it up.

So, yes, Duke took this one, taking advantage when the opportunity presented itself. But the opportunity was unquestionably presented to it not by fate or chance or happenstance, but directly and catastrophically by Wake Forest.

If you’re Duke, you take it and never look back. No pictures on the scorecard and such. It won’t be so easy for Wake Forest to forget. Depending on how the rest of the season plays out, it might be impossible.

Never miss a Luke DeCock column. Sign up at tinyurl.com/lukeslatest to have them delivered directly to your email inbox as soon as they post.

Luke DeCock’s Latest: Never miss a column on the Canes, ACC or other Triangle sports