Arizona State drubbed Stanford by 30 points in January.
Fueled by the memory of that humiliating loss, the Cardinal turned the tables on the 21st-ranked Sun Devils on Thursday night with a 74-64 victory.
"That's always motivation," said Landry Fields, who led the Cardinal with 20 points on 8-of-12 shooting. "That's the kind of stuff that our coaching staff and our players, we don't forget."
Anthony Goods scored 15 points, Lawrence Hill added 13 and Kenny Brown had 12 for the Cardinal (17-11, 6-11 Pac-10), who lost 90-60 to Arizona State on Jan. 2, in Palo Alto.
Stanford won for the first time in eight conference road games, and the Cardinal did it with defense.
In the first 8 minutes, Stanford limited Arizona State to 0-for-6 shooting from the field with five turnovers. The Sun Devils' first basket came with 11:50 to play in the first half, when James Harden split two defenders and scored in the lane.
Stanford limited the Sun Devils 36 percent shooting. That was a big change for the Cardinal, who ranked ninth in Pac-10 field goal percentage defense, allowing opponents to shoot 47.8 percent from the field.
"I don't know where we are ranking-wise, in statistics, in percentage defense and all that," said Hill, a senior from nearby Glendale, Ariz. "I know we were pretty bad. We try to be a defensive team."
First-year Stanford coach Johnny Dawkins seemed a bit surprised when asked about winning his first Pac-10 road game.
"You know, I hadn't thought about it," he said. "Actually, I'm happy you just brought that to my attention. It feels good to win a road game."
The Cardinal hadn't won a game outside the state of California since a Dec. 14 victory at Colorado State. They are 4-7 on the road.
The Wells Fargo Arena crowd was announced at 9,272, and Stanford took it out of the game early.
Stanford's biggest lead was 22-11 with 6:39 to go in the half.
The Sun Devils had more turnovers (8) than field goals (7) in the first half but managed to trim the deficit to 32-26 at halftime.
The second half started pretty much the same as the first. The Cardinal scored the first eight points after halftime to take a 40-26 lead with 15:40 to play.
Stanford led 44-30 when the Sun Devils went on a 7-0 run sparked by a 3-pointer by Rihards Kuksiks, who had missed his first seven shots.
But the Cardinal weathered the storm. Fields had two baskets to push the lead back to 11, and Brown's 3-pointer from the right wing made it 61-47 with 3:49 to play.
Harden scored 22 points and Jeff Pendergraph had 15 points and 11 rebounds for the Sun Devils (21-8, 10-7), who lost their third straight.
Arizona State had trouble shaking last week's overtime losses at Washington and Washington State, which knocked the Sun Devils out of contention for their first Pac-10 title.
ASU coach Herb Sendek said he didn't think the excruciating losses had taken the wind out of his team.
"I can't go there," he said. "How do you know something like that? The minute you allow yourself to trespass into that area, you're using a crutch and you're using an excuse."
ASU starting guard Jamelle McMillan did need crutches after hurting his groin. His availability for Saturday's game against California is uncertain.
Fueled by rare sellout crowds, the Sun Devils had played with emotion in victories over UCLA and Arizona, but they were listless in front of a relatively sparse gathering for Stanford.
"This is like a crazy mystery to me," Pendergraph said. "I don't know what's going on."
With the postseason fast approaching, the Sun Devils have picked a bad time for their first three-game losing streak.
"As a team, we're disappointed in how we're playing right now," Pendergraph said. "Three in a row? it doesn't make any sense."