LOS ANGELES -- Before the game, the UCLA student section serenaded Thomas Welsh with "Happy Birthday."
The senior was giving the gift, though.
Welsh hit a go-ahead 3-pointer with 51 seconds left, lifting the Bruins to an 82-79 victory on Saturday and snapping the Trojans' six-game winning streak.
"That's special when you have a seven-footer who can make threes," UCLA coach Steve Alford said.
Welsh then calmly sank two free throws with 11 seconds remaining and finished with 21 points on his 22nd birthday to seal a third straight win for the Bruins (16-7, 7-4 Pac-12).
"Just stepping to the line and doing the same repetition," Welsh said, describing his mindset with the outcome in doubt. "Just going through my form and knocking them down, not thinking about it."
Aaron Holiday led the Bruins with 23 points, including five 3-pointers, and nine assists while playing 40 minutes. They improved to 12-2 at home.
"Both teams are going to come out fighting and make sure you punch first and keep on punching," Welsh said.
After Welsh's go-ahead 3-pointer, Stewart got fouled and made both, leaving USC trailing 80-79.
Aaron missed a jumper for the Trojans and Welsh got fouled while grabbing the rebound. The Bruins ended the game on a 22-10 run.
"It was a really high-intensity game," USC coach Andy Enfield said. "Both teams played great, especially on the offensive end. It really just came down to that last shot at the end."
"I just really hate losing," McLaughlin said. "The Pac-12 is a tough conference. You have to take care of your home court and try to steal some games on the road."
Rakocevic scored 10 of USC's first 14 points to open the second half, extending the Trojans' lead to 55-53. The Bruins answered with a dunk by G.G. Goloman and a 3-pointer from Holiday for a 58-55 lead.
USC outscored UCLA 14-2 to go back in front 69-60. Stewart had five points and Chimezie Metu four in the spurt.
The Bruins took a 71-69 lead with 11 straight points that included two 3-pointers by Holiday, who converted two free throws after off-setting fouls by Alex Olesinski and Rakocevic, who also got a technical for a tie-up involving Olesinski.
"It was a flagrant foul by (UCLA), and Nick retaliated," Enfield said. "I just told Nick that he should have just let him be."
USC built an 11-point lead midway through the first half before UCLA erased most of it with a 14-2 run. Chris Smith came off the bench to score four points and Holiday sandwiched 3-pointers around a free throw by Smith that put the Bruins ahead 30-29.
The game was tied twice more before USC got four straight points by Stewart to lead 41-40 at halftime.
USC: The Trojans were 7-1 in January for their most wins in the month since going 7-2 in 1982. They are second in the league standings behind Arizona. "We just have to really watch film and stay consistent about the things that we do, and we should be OK," McLaughlin said.
UCLA: The Bruins have seven regular season games remaining, with just two of those at home. The victory gives their NCAA Tournament hopes a much-needed boost, but they face a tough trip to the Arizona desert next week.
USC's Bennie Boatwright returned after missing two straight games because of a sore right foot. He finished with two points on 0-of-5 shooting and missed all three of his 3-point attempts in nine minutes. He averages 15.1 points.
USC: At No. 25 Arizona State on Thursday in the second of three straight road games. The Trojans have lost five in a row in Tempe by an average of 4.4 points.
UCLA: At No. 9 Arizona on Thursday in the teams' only regular season meeting.
More AP college basketball coverage: http://collegebasketball.ap.org and https://twitter.com/AP-Top25
Tony Bennett is renowned for his defensive schemes at Virginia. Jay Wright has turned Villanova into an offensive juggernaut. Which coaches rank highest on each side of the ball?
Facing grand larceny charges, Michael Weathers was suspended by Oklahoma State.
The recruiting landscape is heating up. Find out where the top 30 players in the 2019 ESPN 100 are headed next season.