LOS ANGELES (AP) Stanford led all the way against Southern California only to almost lose in the last second.
The Cardinal went cold in the final 5 minutes, missing on eight straight possessions while getting outscored 10-1 before escaping with a 78-76 victory Sunday night.
''We were fortunate to close it out in the end,'' Cardinal coach Johnny Dawkins said. ''It wasn't pretty, but we were able to close it out against a team that was really hungry and really made it hard for us.''
Anthony Brown had 21 points and 10 rebounds and Rosco Allen added career highs of 18 points and four 3-pointers for Stanford (11-4, 3-1 Pac-12). Stefan Nastic had 15 points and Chasson Randle 12 points for the Cardinal, which was coming off an 86-81 double-overtime loss at UCLA two nights earlier.
''It was definitely lesson learned,'' Brown said. ''We didn't want to have two leads in back-to-back games and lose. Coach made a great call at the end of the game going from man to zone. We executed and came out with the `W.'''
The Cardinal earned its first three-game winning streak against USC since 2004-05, when it won four in a row. Nastic made one of two free throws with 1 second left to keep the Trojans at bay after the Cardinal blew most of a 13-point lead.
''For us, it's more of a function of closing out games,'' Dawkins said. ''We talk a lot about finishing. At the end of the day we were able to win one of those games.''
Julian Jacobs scored 16 points to lead USC (9-7, 1-3). Jordan McLaughlin added 14 points and Nikola Jovanovic 13 points as the Trojans lost for the fourth time in seven games after shooting 50 percent in the second half.
USC rallied in cutting its deficit to 77-71 on Elijah Stewart's dunk off his offensive rebound of McLaughlin's missed 3-pointer. Jacobs and Stewart combined for nine straight points after the Trojans trailed by 13.
''We should have played the whole game like we played the last 10 minutes,'' McLaughlin said. ''We came out pretty slow. You got to play hard right from the jump.''
The Cardinal missed five 3-pointers in the last five minutes. Rosco Allen lost the ball - their 14th turnover - and Brown fouled McLaughlin, who made both free throws to get the Trojans to 77-74.
''McLaughlin came in and gave them a big spark,'' Brown said. ''It was ugly but we got the `W.'''
Brown's 3-pointer from the right corner clanked off the rim and McLaughlin scored on a fastbreak layup, leaving the Trojans trailing 77-76 with 41 seconds left.
Brown missed another 3 from the same spot with 14 seconds to go. But McLaughlin turned the ball over in the paint.
''When I crossed over I lost my footing and just slipped,'' McLaughlin said. ''I felt like I would have been able to get a good shot.''
USC coach Andy Enfield said, ''He left his heart on the court. I feel for him for tripping over his own feet. We thought we had enough time to penetrate and drive and kick. He just tripped. He would've had a clean look at the basket for a shot.''
Jovanovic fouled Nastic, who sank a critical free throw to preserve a win in which Stanford never trailed.
''For us to come in and at least get one is good for us, good for our growth,'' Dawkins said. ''And we know we have to get better.''
The Trojans got within four on consecutive baskets by Strahinj Gavrilovic and Darion Clark early in the second half. Stanford answered with nine straight points, starting with a 3-pointer by Allen, to extend its lead to 68-55.
Stanford: Randle was held under his Pac-12 leading average of 19.8 points. He was coming off a 32-point effort at UCLA. ... The Cardinal had gone to overtime in three of previous five games.
USC: McLaughlin returned after missing two games with a separated right shoulder and had just one practice under his belt.
Stanford made 10 3-pointers in the game, but just 1 of 12 in the second half.
''That is not something that we build our team on and now we're starting to fall into that trap,'' Dawkins said. ''There are days that they go in and days that they don't.''
Stanford: At California on Wednesday.
USC: Host UCLA on Wednesday.