LOS ANGELES (AP) UCLA was facing a trap game against Long Beach State, and for a half the Bruins were ensnared.
They broke out in the second half to build a 12-point lead before having to fight to the finish for an 83-76 victory Sunday night.
Bryce Alford scored 24 points, tying his season high with five 3-pointers, and Isaac Hamilton added a season-high 21 points for the Bruins (6-3), who blew most of a double digit lead in the second half when the 49ers (5-5) twice got within one.
UCLA was coming off an emotional 87-77 upset of No. 1 Kentucky three nights earlier at Pauley Pavilion.
''We knew it was going to be hard coming off the Kentucky win with finals staring us in the face,'' Bruins coach Steve Alford said. ''We can't be a team of excuse, we've got to be a team of growth.''
Hamilton's 3-point play with 51 seconds left sealed it for UCLA. Tony Parker had 16 points and 10 rebounds, and Thomas Welsh had 15 points and 10 rebounds.
Nick Faust led the 49ers with 24 points, tied his career high with five 3-pointers and had seven rebounds.
The 49ers led the entire first half, when UCLA fell behind by nine before trailing 38-37 at the break.
''They came out and hit us pretty good. We don't like starting games that way,'' the elder Alford said. ''They really got their transition game started early. We're still not as nasty defensively as I want to be.''
UCLA opened the second half with a 21-10 run to take its largest lead, 60-48. Alford scored six points, Hamilton five, and Welsh and Parker four each in the spurt that ended with Alford's fourth 3-pointer of the game.
The 49ers hung in and got to 76-74 on a 3-pointer by Justin Bibbins with 2:09 to play. But Parker dunked, Hamilton got fouled coming across the lane for a layup and Alford hit two free throws to close out the win.
''It was good for us to grind it out and get a win when we had a lot going against us,'' the younger Alford said.
Faust hit his fourth 3-pointer seconds before the halftime buzzer for a one-point lead.
The 49ers' largest lead, 32-23, came after an 8-0 run in which Noah Blackwell sandwiched 3s around a basket by Mason Riggins. They had seven 3-pointers in the half.
''We played a really solid thirty minutes,'' Long Beach State coach Dan Monson said. ''But we have to understand that this was a great team and you have to sustain that effort the whole game.''
The Bruins rallied to close the half with a 14-6 spurt, including 10 points by Alford, who had two 3-pointers.
Long Beach State: The 49ers concluded their busiest stretch of the season, having played four games in six days. ... They fell to 1-14 all-time against the Bruins. ... In a scheduling quirk, the 49ers beat New Mexico State 67-53 a night earlier. ... Faust has led the 49ers in scoring in seven of their 10 games. ... Their bench outscored the Bruins' reserves 23-3.
UCLA: Denny Crum, the 78-year-old Hall of Famer who played for the Bruins from 1956-58, served as honorary game captain. ... Kentucky was the first of three ranked teams the Bruins are playing in just over two weeks. After traveling to No. 13 Gonzaga next Saturday, they will play No. 9 North Carolina in Brooklyn, New York, on Dec. 19. ... Former Bruins coach Steve Lavin called the game for the Pac-12 Network. ... The Bruins begin finals week on Monday. ... Alford, a junior, is five points from becoming the 52nd player in UCLA history to score 1,000 points.
The 49ers made 11 3-pointers a night after hitting a season-high 14 against New Mexico State. Faust led the way with five and Blackwell added three.
''We wanted to chase this team off the 3-point line, but that's easier said than done,'' Steve Alford said. ''They took a few from NBA 3-point range.''
Long Beach State visits Pepperdine on Wednesday.
UCLA plays at Gonzaga on Saturday.