Bill Self is disappointed in the Jayhawks' first loss, but sees the game as a learning experience for his team. (0:34)

TEMPE, Ariz. -- Top-ranked Kansas was upset Saturday night by No. 18 Arizona State, but to Jayhawks coach Bill Self, the 80-76 loss came at the right time.

"I think that losing sucks, and it's never good, but it actually can be a positive if you learn from it so that it doesn't happen again the same way," Self said. "We didn't close the game right at all, so hopefully, we can learn from that. But the reality of it is, we weren't going to run the table. Let's not get carried away.

"I hate saying this, you never ever want to lose, but certainly you'd rather learn from a nonconference loss than a conference loss. So hopefully, we'll learn something from it and get better from it. I think it'll be a good teaching tape for us."

The Jayhawks made only one field goal in the final 7 minutes, 9 seconds -- a 3-pointer by Lagerald Vick -- allowing ASU to hang around long enough to take the lead.

Kansas led until the 2:23 mark, when Sun Devils transfer Rob Edwards hit a 3-pointer from the right wing to put ASU up 76-74. The Jayhawks tied the score at 76 when junior forward Dedric Lawson hit two free throws with 1:17 left.

ASU sophomore point guard Remy Martin hit an off-balance runner near the free throw line with 59 seconds left to give the Sun Devils the lead again, 78-76. After two turnovers by Kansas and one by ASU stalled both a comeback by the Jayhawks and prevented ASU from sealing the win, Edwards hit two free throws with six seconds left to secure the upset.

When the final buzzer sounded, Sun Devils fans stormed the court at Wells Fargo Arena. Later in the locker room, ASU players doused coach Bobby Hurley.

"I've never gotten a feeling of rushing the court," Martin said. "I didn't know they were gonna rush the court. So I was like ... all these people are coming at me. I'm like, 'Where are they coming from? Are we really doing this right now?' But those are the moments we live for, man.

"We fought our hardest to accomplish what we did."

Hurley, who won two national championships in three Final Four appearances as a Duke player, called Saturday's win "one of the great sports moments of my life."

And it can be considered the biggest win in Sun Devils history.

"This was just a huge moment for our basketball program," Hurley said. "I remember when I first started, my first couple games here, and to see what it's like now, it's unreal.

"So to have these memories, and for our players to have it, it's terrific."

Saturday was the second time in two seasons that ASU upset Kansas. Last season in Lawrence, the Sun Devils, then ranked 16th, toppled then-No. 2 KU.

On Saturday in Tempe, anytime ASU got close, which it did often in the final seven minutes, pulling within a basket five times before taking the lead, Kansas used free throws to keep stretching its slim margin. But the Sun Devils kept chipping away.

"We didn't finish down the stretch," Self said. "We did a really poor job of [stopping] Edwards. I thought he was terrific. I mean, he was really the difference in the game because when we had control of the game, he basically single-handedly brought them back."

Edwards finished with an ASU-high 15 points, one of five Sun Devils to finish in double digits. Freshman Luguentz Dort and senior Zylan Cheatham each had 13, Sophomore Romello White had 11 and Martin had 10.

Lawson, a junior forward for Kansas, finished with a game-high 30 points and 14 rebounds but had only 12 points in the second half, when the Sun Devils made a conscious effort to double-team him.

Saturday's win was ASU's first win over a No. 1 team since the Sun Devils toppled Oregon State on March 7, 1981, in Corvallis. It was also Arizona State's first win over a No. 1 team at home.

The loss ended Kansas' bid for an undefeated season at 10 games. The Jayhawks began the season ranked No. 1 and reclaimed the top spot on Dec. 10.

After the game, a number of Sun Devils left Arizona to head home for Christmas, celebrating a season-defining win.

"There's going be a lot of happy guys flying through the night to their families to have a great Christmas," Hurley said. "It makes Christmas so much better."