When the bowl matchups were announced a month ago, this one had trouble written all over it.

Based on a 12-game track record for both Iowa and Mississippi State, it seemed like the Hawkeyes were in big trouble in the Outback Bowl in Tampa. Mississippi State, with the No. 1-ranked scoring defense in the country, had the personnel on that side of the ball to completely stifle the Hawkeyes offense.

And why not?

All year during this Iowa season of what-might-have-been, the Hawkeyes offense has always stumbled in the biggest moments. Now, here they were, stuck in a bowl matchup where that offense might NEVER get untracked.

But games aren’t played on paper, and this veteran Hawkeyes team had other ideas. Their 13 seniors wanted to go out in style, and they did, winning 27-22 on Tuesday for their ninth win of the season.

There’s plenty of credit to go around, but the praise train has to start and finish with junior quarterback Nate Stanley. The 6-foot-4 junior stood tall amid enormous pressure and kept delivering one big play after another. He threw 3 touchdown passes and had the game of his life, considering the circumstances.

Stanley hung in there against this great Mississippi State defense, even after Iowa gained only 9 yards on its first 16 plays. He finally found a way to make a few big strikes, scoring 17 points on Iowa’s next three possessions in the second quarter.

Mississippi State hadn’t given up points on three straight possessions ALL YEAR!

Stanley had three completions on the first drive, and the Hawkeyes benefitted from two 15-yard MSU penalties to get into field goal range. Miguel Recinos made one from 44 yards to make it 6-3.

Then the big plays started. On Iowa’s next possession, Nick Easley made a nice stop-and-go move on a defender and he was wide open down the right side. Stanley threw a perfect strike and Easley went untouched for a 75-yard score.

After a Bulldogs fumble, the Hawkeyes just needed two plays to score again, with Stanley throwing a perfect ball to Ihmir Smith-Marsette from 15 yards out to give the Hawkeyes a shocking 17-6 lead.

“We just kept hanging in there and we made some big plays,” Iowa coach Kirk Ferentz said. “We went nowhere offensively in the first quarter, obviously. But we hung in there and made some things happen.”

Those bad Stanley moments throughout the season — most notably that goal-line interception that turned a win into a loss at Penn State — crept back at the start of the third quarter, which might have been the ugliest four minutes of the season.

Stanley threw a bad interception on the first possession of the second half. After being sacked on first down, he locked in on Smith-Marsette and Mississippi State safety Willie Gay read it all the way, picking it off and returning it to the Iowa 6. Mississippi State scored three plays later to make it 17-12.

On the ensuing kickoff, Smith-Marsette tried hurdling an MSU tackler and the ball hit the helmet of an Iowa blocker. Mississippi State scored on the first play, a 33-yard run by quarterback Nick Fitzgerald, to take a 19-17 season.

That 11-point halftime lead? Poof! Gone, in an instant.

But here’s where Iowa deserves an enormous amount of credit. When it would have been easy just to pack it in while under duress, they rallied once again, with Stanley leading the way. After a third Mississippi State turnover, Iowa went 32 yards for the go-ahead score, but not without some high-stress drama. On fourth-and-1 from the 1, Iowa opted to go for it instead of kicking a field goal to take the lead. Stanley got it with a 3-yard run, and then hit Nick Easley with a perfect throw for an 8-yard score to make it 24-19.

At that point, Stanley had completed passes to five different receivers, but none were to All-American tight end T.J. Hockenson. That changed on the Hawkeyes’ final scoring drive, when he found his favorite tight end for completions of 20 and 22 yards to start the drive. They got into field goal position, and Recinos delivered again to push the lead to 5 points at 27-22.

Iowa’s defense, which is pretty tough themselves, took it from there, stopping Mississippi State’s last-gasp effort.

It was, in a nice 60-minute window, the perfect way for the Hawkeyes to finish this season. They were 7-point underdogs against a powerful SEC team that hadn’t even allowed a touchdown in nearly three full games coming into this bowl game.

And then the Hawks go out and score 27, shocking everyone. It was a perfect farewell for the seniors, and a perfect start to the offseason for those who are coming back next year intent on working their way back into the Big Ten Championship Game.

Don’t put it past this team. They’ve got the right character — and the right characters, starting with Stanley — to do it.