DALLAS — Montana State should not have been this close.

Not on a sweltering Saturday night in Dallas in which temperatures hovered in the 90s long after kickoff. Not against a Football Bowl Subdivision foe, and certainly not after a whirlwind 24 hours, 12 of which were spent idling at Gallatin Field because of plane trouble. The Bobcats were scheduled for a walk-through at Southern Methodist’s Gerald J. Ford Stadium at 7 p.m. Friday; instead, they were throwing passes on the tarmac and wheelchair racing through the terminal, which also served as a special teams meeting room. They didn’t even make it to Texas until 2 a.m.

The Bobcats should not have stuck around in the second half after the two-touchdown lead they had amassed midway through the second quarter dwindled to just three in mere minutes. They lost all momentum — and kicker Rory Perez — on the final play of the opening half, an electric 55-yard punt return from the Mustangs’ JaBryce Taylor.

Against all odds, however, Montana State clung to a five-point lead in the final minute of the fourth quarter thanks to opportunistic defense that forced two turnovers and the steady, physical running of senior workhorse Cody Kirk. But as the seconds slipped off the clock, so did the game.

An untimely sack dropped the Bobcats out of field goal position, and then SMU quarterback Garret Gilbert orchestrated the night’s final scoring drive — 13 plays for 81 yards in 3 minutes, 34 seconds.

On the final snap of that march, the senior Texas transfer hung in the pocket and fired a strike to wide receiver Darius Joseph, who hauled in his 12th and most important catch of the night — a 4-yard touchdown with just 12 seconds remaining to seal a 31-30 win for the home team.

So close.

The angst was written all over the face of Bobcats head coach Rob Ash some 20 minutes after his squad strolled up the tunnel and into the locker room. He attempted to lighten the mood in the interview room, joking that “Quinn (Catalano) sweats a lot” as he rested on a damp seat the offensive lineman had previously occupied.

Ash’s somber tone and bloodshot eyes were hard to ignore, however.

“I told them I loved them and I was proud of them. They handled themselves beautifully this weekend,” he said.

“I’m disappointed we couldn’t get one more pass knocked down and pull out a win. They deserved that.

“This was a good opportunity that I wish we could’ve converted.”

Montana State did just that seemingly all evening.

The Bobcats’ first play — a handoff to Kirk from the shotgun deep in their own end — resulted in a safety, but they answered with three seven-play scoring drives to stake themselves to a 22-5 lead with 8:13 remaining in the first half.

Kirk barreled into the end zone from 1 yard out to put MSU ahead with 2:23 in the first, a score that DeNarius McGhee helped set up with a gutsy and accurate 40-yard pass to Brian Flotkoetter on a third-and-15 play.

Receiver Jon Ellis stretched the advantage to 10 points 12:16 before the half when he hauled in a short pass, eluded one defender, bounced wide and won a race to the pylon.

Shawn Johnson dove across the goal line from 2 yards out about four minutes later.

The Montana State offense was content to go the ground often in the second frame; they possessed the ball for just 3:37 in the opening quarter but 7:46 in the second.

“I feel like they underestimated us; some of their guys came up to us and said, “We thought you were smaller. Wow, you’re a lot bigger than we thought,’” Catalano said. “We came down here and wanted to hit them, show them what MSU football was all about and represent for the FCS.

“We tried to keep the ball out of their offense’s hands. Cody ran hard. Everybody ran hard. We ran right at them, tried to get physical with them.”

It initially worked, but SMU responded in front of a sparse crowd of 10,107.

K.C. Nlemchi scored from 2 yards out at 5:12 in the second, capping a seven-play, 51-yard drive that cut the Mustangs’ deficit to 10.

The Bobcats attempted to bleed the clock, but the plan backfired; Taylor caught a punt in the final seconds as the first level of the Bobcats’ special teams unit flew by, and then eluded Perez on his 55-yard run to the end zone.

“For whatever reason — and it can’t happen again — we were a little lethargic coming out at the beginning of the game,” said Gilbert, who completed 22-of-31 passes for 219 yards and added 29 more on the ground. “Coach Jones always talk to us about being a hero, which means being one who is capable of inspiring others. … That (return) really gave us some energy. He was just a spark.”

The ’Cats were undaunted, however. They opened the third quarter with an 10-play scoring drive, one in which they converted once on third and fourth downs; on the latter, a fourth and 2 from the SMU 30, McGhee hooked up with tight end Tiai Salanoa for 11 yards and a first down. Soon after, Kirk shook free for 12 yards and his second score.

Kirk, who rushed 11 times for 39 yards in the opener, carried the ball 29 times for 107 yards Saturday — an average of 3.7 a carry. He was the primary reason the Bobcats picked up 25 first downs, three more than SMU.

“He’s a fabulous player,” Ash said of Kirk. “He’s determined, he’s competitive, he’s strong and he’s worked to make himself a great player. … He’s the heart and soul of our team, and I feel bad for him. He had a great chance to help us win a big football game.

“There’s nothing more he could’ve done, that’s for sure.”

Chase Hover nailed a 42-yard field goal on the ensuing possession, and then his third of the night with 9:53 remaining in the fourth as the Mustangs pulled to within five.

The Bobcats maintained possession for the next six minutes, but their drive ultimately stalled; McGhee scrambled on a third and long and was sacked, dropping his squad out of field-goal range.

Trevor Bolton, filling in for Perez, shanked a punt that rolled to the SMU 19.

Then, Gilbert took over.

“You really like it not to be that close there at the end, but I grew up watching John Elway, Peyton Manning and Tom Brady engineering those last-minute drives. It’s fun to have the ball in your hands,” Gilbert said. “The offense did a heck of a job as a unit, and we gave ourselves a chance to win the game.”

SMU seized the opportunity. Gilbert completed eight passes on a 13-play final drive, which was aided by a Bobcats pass-interference penalty; that call came immediately after linebacker Alex Singleton sped into the backfield and dropped Gilbert for a loss of 6.

“I’m not complaining, but that pass interference call was a big play; we just had a sack and almost got to the quarterback again. … Maybe that drive doesn’t even start,” Ash lamented. “I wasn’t too nervous about it and neither were my defensive coaches. They were getting a lot of little chunks and the clock was running down fast; time was our ally. … The whole drive I was thinking we were going to pick one off, knock one down or get to (Gilbert).”

Added Singleton, “I felt like we were picking up momentum as the game was going along. It was just execution, one or two plays that went their way and not ours.”

On third and goal from the 3 in the final seconds, Gilbert dropped back and scanned the field. He looked in the flat, then turned and spotted Joseph across the middle.

“The safety committed hard. … We both saw the same thing, and DJ was able to break across and make a great catch,” Gilbert said. “That last drive was a team effort.”

And a heartbreaking end for Montana State, which dropped its second one-point game to an FBS squad (Washington State, 2011) in the past three seasons.

“I suppose (we can take some positives away from this performance), but we really came down here to win,” Ash said. “That’s something we need to do for the goals of the season and where we wanted to be after two weeks. We’ll fight back, line up and keep playing. We’ll do fine, learn from this and get better.”

Added Catalano, “We’ll move on from this; it’s not like we just lost everything. Now, it’s all about Colorado Mesa.”

Jon Maletz can be reached at jmaletz@dailychronicle.com or 582.2601. Follow him on Twitter @jmaletz.

Sports Editor