San Diego State entered the fourth quarter Thursday with an excellent shot of advancing to the Final Four of the Women’s Basketball Invitation Tournament.

But host Kansas weathered a barrage of 3-point shots and then outscored the Aztecs 15-8 over the last five minutes to defeat San Diego State 85-78.

The Aztecs, who finished the season 27-6 and tied the school record for most wins in a season, shot a season-best 54.5 percent from the floor (30-for-55), including going 11-for-26 from 3-point range.

“We played really hard,” coach Stacie Terry-Hutson said after her Aztecs were eliminated. “We didn’t have enough in the tank down the stretch. And I thought we were on the short end of some foul calls. We were right there.”

Down 25-15 after the first quarter, the Aztecs hit 5 of 6 3-pointers in the second quarter to pull to within three points at intermission. The Aztecs out-scored Kansas (22-13) 50-38 over the two middle periods to take a 65-63 lead into the fourth quarter.

But the Aztecs made only 5-of-15 shots in the fourth quarter and went 1-for-6 from beyond the arc. Meanwhile, Kansas was making six of its last seven field goal attempts.

San Diego State also entered the final quarter with three players — forwards Bailey Barnhard and Maria Konstantinidou and guard Natalia Martrinez — with four fouls. The Aztecs drew 19 fouls in the game to eight against the Jayhawks, who enjoyed a 15-7 margin in points from the foul line.

Naomi Panganiban led the Aztecs with 20 points.

Kaelyn Hamilton, the sixth woman of the year in the Mountain West Conference, scored 15, while 6-foot forward Kennedy Lee had 14 points, a dozen of which came on four 3-point shots in the first half.

She also led the Aztecs with five rebounds. Mountain West player of the year Nala Williams had six points and seven assists.

Freshman Jaliya Davis led Kansas with 25 points and six rebounds. Point guard S’Mya Nichols scored 18 points with five assists. But the difference was 6-foot-3 forward Lilly Meister. A 27 percent 3-point shooter on the season, Meister went 4-for-4 Thursday and finished with 14 points.

The game was tied 70-70 with 5:32 to play when Nichols hit a mid-range jumper to put Kansas on top to stay at 72-70. Davis then scored eight of the Jayhawks’ final 13 points.