With 19 seconds left, Tracy Claeys lost his mind and didn’t exactly help his cause in landing the Gophers head coaching job full-time.

Seriously, what the heck was that?

In his first game as Jerry Kill’s replacement, Claeys apparently benched his punter in crunch time over one bad punt and then botched the final 19 seconds in one of the worst clock management sequences you’ll ever see.

Gophers football has experienced some painful, mind-boggling, ridiculous losses in its history, but what took place Saturday night might top them all.

The Gophers won and then they lost.

No, they gave it away. Gave it away on a night when emotion filled TCF Bank Stadium and when so many things went right for the home team.

But that final sequence? Woof.

The Gophers had a touchdown overturned, lollygagged with time ticking away and then turned down a chance to tie the score with a gimme field goal in those final 19 seconds.

The result: a deflating 29-26 loss to No. 15 Michigan.

“Came up a play short,” Claeys said.

The blame for that falls squarely on the coaching staff, namely Claeys and offensive coordinator Matt Limegrover.

The Gophers looked like they would script a storybook ending when Mitch Leidner floated a perfect 23-yard touchdown pass to Drew Wolitarsky with 19 seconds left.

But replays showed Wolitarsky’s knee touched just short of the goal line.

The clocked started after the ball was set and the Gophers used a cockamamie shift in which players moved all over the formation, wasting precious time.

Claeys said he knew the clock had started, which seems questionable, but if so, why would he and/or Limegrover call such a slow-developing play with a lot of pre-snap shifting?

Leidner admitted that he didn’t realize the clock had started. He rolled out and attempted a throwback pass that fell short with 2 seconds left.

So, the play took 17 seconds and nearly ran the entire clock out, which would have been an egregious blunder.

After a timeout with two seconds, Claeys went for the win instead of overtime. We can debate that decision, but the play call couldn’t have been more obvious.

Leider tried a quarterback sneak but was stuffed at the line as time expired.

Ballgame.

“Obviously, it didn’t work and it was my call,” Claeys said.

Once officials verified on replay that Leidner indeed was stopped short of the goal line, Michigan’s players sprinted across the field to retrieve the Little Brown Jug.

“Disappointed, that’s probably the biggest word I can think of,” defensive tackle Steven Richardson said.

In the immediacy of the moment, this one felt more stunning than Michigan 2003.

And Michigan 2004.

And some of the other collapses and weird endings in Gophers football lore.

Claeys made a decision earlier in the fourth quarter that contributed to the bizarre finish and felt remarkably knee-jerk.

He replaced all-Big Ten punter Peter Mortell with placekicker Ryan Santoso with the Gophers backed up to their 11-yard line with less than nine minutes left in the game.

Mortell hit a bad punt in the first half that resulted in a low line drive that Michigan’s Jabrill Peppers returned 41 yards. Mortell appeared to get up limping after tackling Peppers, but Claeys said his punter was fine physically.

He said he benched him because of his poor execution.

“Pete didn’t put the ball where he was supposed to,” Claeys said. “And that caused a long return. We worked two weeks on it, and so, hey, let’s give the other guy a try. Placement of the ball is so important in punt coverage, I mean, it really is.”

And so clinging to a 26-21 lead against the 15th-ranked team in the country, Claeys sent out his kicker to punt from deep in his own end.

The result: a 29-yard punt that gave Michigan starting field position at the Gophers 40.

Inexcusable, if Mortell indeed was healthy enough to punt.

Backup quarterback Wilton Speight guided the Wolverines to a go-ahead touchdown.

Leidner, who was terrific all game, showed poise in putting his team in position to win, until that final sequence. Those final 19 seconds.

The Gophers thought they won. They were ready to celebrate. A jubilant ending after an emotional draining week was practically written.

And then it all vanished. Just like that.

We’ve seen that movie before.