TEMPE – Despite a surprising 87-80 loss at ASU today, the Arizona Wildcats’ Pac-12 Tournament path remains the same.

But the Wildcats may now have to win the whole thing in order to receive an NCAA tournament berth.

Arizona allowed ASU to score its most points of the season, with the Sun Devils connecting on 55.8-percent of its field goals – including easy layups and wide-open three-pointers alike. ASU also made 22 of 24 free throws.

The loss ended the Wildcats’ regular season at 21-10 overall and 12-6 in the Pac-12, where they finished alone in fourth place. UA will face the winner of the No. 5 UCLA vs. No. 12 USC first-round game in the Pac-12 Tournament quarterfinals next Thursday in Los Angeles - the same position it would have been in with a victory today.

ASU improved to 10-20 and 6-12, finishing in 10th place, and will face No. 7 Stanford in the first round of the Pac-12 Tournament on Wednesday.

Jonathan Gilling hit a three-pointer with 1:11 left to give ASU a 81-77 lead but Kyle Fogg converted a three-point play with 51 seconds left to put UA back down by just a point.

Trent Lockett then hit two free throws to make it 83-80 and UA called timeout with the ball and 29 seconds left. Josiah Turner missed a layup with 19.7 seconds left and UA fouled Lockett, who went to the line and made both free throws to put ASU ahead 85-80 and the Sun Devils hung on from there.

Gilling, Lockett and Carrick Felix each had 21 points for ASU, while Gilling was 5 of 6 from three-point range. Fogg was fouled on a three-pointer with 1:44 left and hit all three free throws to pull UA within 78-77.

UA took a 70-68 lead on a three-point play by Turner with 5:58 to go, but Felix made two free throws to tie the game at 70 with 5:11 left and ASU coach Herb Sendek called timeout.

Already, though, Miller had called two timeouts in the second half because of an ASU surge: The first after 88 seconds, when ASU went on a 7-0 run after halftime, and the second with 8:19 to go when the Sun Devils went ahead 63-59 with 8:19 to go. ASU was able to get Gilling wide open at the top of the key repeatedly, and he was 4 for 4 on threes and had 18 points overall midway through the second half.

In the first 88 seconds of the second half, ASU erased UA’s 44-38 halftime lead when Jordan Bachynski scored inside, Felix made a three-point play and Felix scored again inside after a missed shot by Jesse Perry.

In the first half, a last-minute surge allowed Arizona to overcome a poor defensive effort and take a 44-38 halftime lead. The Sun Devils were shooting 60 percent from the field until late in the half, getting many of their baskets easily inside, until they cooled down at the end of the half.

UA finished off with an 8-2 run that broke the Wildcats free from a 36-36 tie. Brendon Lavender had two three-pointers over the final stretch, while Perry scored off a steal and assist from Turner with nine seconds left.

Solomon Hill led UA in scoring with 12 points, though he spent the final minutes of the half on the bench with two fouls. Perry added nine points, five rebounds and three blocks for the Wildcats.

Gilling led ASU with 13 points, having made all three three-pointers he took. Both teams wound up shooting 52 percent from the field.

Hill drove for a layup to give UA a 34-33 lead with over three minutes to go. Hill now has 12 points. Arizona took a 32-31 lead with six minutes to go when Hill hit a three-pointer that followed a three from Lockett.

ASU had shot 64.7 percent from the field to that point. ASU was leading 19-17 with 11:33 left, having scored inside easily on several occasions. UA lead 8-5 at the first media timeout.

UA coach Sean Miller started Turner, Nick Johnson, Kyle Fogg, Hill, Perry. Miller had started Lavender for the Wildcats’ two final home games last week, one in place of Turner and another in place of Johnson.

Regardless of today’s game, the Wildcats will be the No. 4 seed in the Pac-12 Tournament and open with the winner of the No. 5 UCLA-No. 12 USC game on Thursday at 3:30 p.m. MT.