PORTLAND, Ore. (AP) — Jordan Pope and Matas Vokietaitis each scored 17 points, Camden Heide hit a game-sealing 3-pointer and Texas became the first team in five years to go from the NCAA Tournament’s First Four to the Sweet 16, beating Gonzaga 74-68 on Saturday.

First-year coach Sean Miller’s 11th-seeded Longhorns (21-14), who lost five of six entering the tournament and looked underwhelming in their First Four win over N.C. State, will face either No. 2 seed Purdue or No. 7 seed Miami on Thursday in the West Region semifinals in San Jose, California.

The last First Four team to reach the Sweet 16 was UCLA, which made it all the way to the Final Four in 2021.

“Our ride has never been easy, but we fought the good fight the whole way and we did it again,” Miller said.

Graham Ike led third-seeded Gonzaga (31-4) with 25 points, but the Bulldogs struggled to generate much secondary scoring.

Coach Mark Few’s Zags bowed out in the second round for the second straight year after reaching the Sweet 16 in nine consecutive tournaments, a run that included two losses in the national title game.

After Ike’s dunk got the Zags within 69-68 with 40 seconds left, Miller called timeout and drew up a play that got Heide free in the corner. The 6-foot-7 junior, who played just 13 minutes, confidently knocked down his only basket of the game, giving Texas a four-point lead with 14.7 seconds left.

“He’s our best 3-point shooter. To not have him in there, I just didn’t think it made any sense, because what happens is exactly what happened,” Miller said. “The play gets broken, a guy makes a drive, pivots, Next thing you know, you find someone.”

Vokietaitis capped the scoring with a breakaway layup.

Gonzaga, a 6 1/2-point favorite according to BetMGM Sportsbook, led by eight points in the first half, but Texas rallied and led 35-33 at halftime.

Dailyn Swain dunked to give the Longhorns a 57-54 lead with 7:33 left.

Pope’s 3-pointer with 5:28 remaining put Texas up 62-56. Ike’s layup closed Gonzaga within 66-64, but Pope answered with a 3 to put Texas ahead 69-64.

“We were both kind of trading punches,” Few said. “Both teams were having a hard time getting stops down the stretch, and we just couldn’t get one on that last possession. I would have liked to see if we could capitalize in our coverage, but Heide had that big 3, and that was about really what it came down to.”

It’s the 15th Sweet 16 appearance and first since 2022-23 for Texas, and the ninth for Miller, who got to five regional semifinals with Arizona and three with Xavier.

The Bulldogs were making their 27th appearance in the tournament, and they played in front of a friendly crowd that chanted “Let’s Go Zags!” after David Fogle’s jumper made it 28-20 in the first half.

Gonzaga beat No. 14 seed Kennesaw State on Thursday, but this result could lead to some angst in Spokane, Washington, before the Zags join the reconstituted Pac-12 ahead of next season.

Texas, meanwhile, rode the momentum after knocking off likely NBA lottery pick AJ Dybantsa and BYU in the first round. The Longhorns became the first-double digit seed in this largely chalky tournament to get through the first two rounds.

“We just needed a chance,” said Swain, who finished with 11 points. “We didn’t end the regular season in the way we wanted to, but we never gave up on each other and that drew us closer. We all took a different approach, we all kind of stepped up our play, and as you can see, had a more balanced attack in this postseason.”

___

AP March Madness bracket: https://apnews.com/hub/ncaa-mens-bracket and coverage: https://apnews.com/hub/march-madness