LONG BEACH, Calif. (AP) Mike Caffey scored 22 points and made the winning layup with 16 seconds left, giving Long Beach State a 72-71 victory over Southern California that snapped the 49ers’ nine-game skid on Thursday night.

Byron Wesley’s jumper missed at the buzzer for the Trojans, who erased a 16-point deficit in the second half only to fall to 0-2 on the road.

READ MORE: Lakers Top Pistons, 110-106, One Week After Scuffle Between Two Teams Took Place

Tyler Lamb scored 18 of his 20 points in the first half of his first game for the 49ers after transferring from UCLA last January. The 49ers (2-9) beat a Pac-12 team for the first time in three tries this season after earlier road losses to Arizona and Washington.

Pe’Shon Howard, who led USC with 19 points, saw his jumper bounce off the rim with 24 seconds to go and the Trojans clinging to a 71-70 lead. Omar Oraby added 17 points and 10 rebounds for the Trojans (7-3), who fell to 2-12 in their last 14 non-conference road games. They came in having won seven of their previous nine.

Byron Wesley, USC’s leading scorer who averages 17.3 points, was a late scratch from the starting lineup by coach Andy Enfield. Wesley finished with two points in 21 minutes. His potential go-ahead jumper at the buzzer missed and Wesley bent over, his head in his hands and his ears full from the noisy crowd of 4,410 at Walter Pyramid.

The 49ers were playing their first game since Dec. 7 when they lost at North Carolina State, part of their tough early season schedule that has included losses to Kansas State (twice), Michigan, VCU and Creighton.

They took it to USC early, shooting 54 percent from the floor in building a 50-36 halftime lead. The 49ers trailed by five to open the game and then outscored the Trojans 26-9 to lead 28-16. Lamb came into the game during the run and contributed nine points. The 49ers closed the spurt with 10 straight points, including consecutive 3-pointers by Kris Gulley and McKay LaSalle.

READ MORE: Alhambra Ice-Cream Shop Victim Of Smash-And-Grab Burglary Early Saturday Morning

The Trojans shot 41 percent and had seven turnovers in the half.

Caffey’s basket to start the second half gave Long Beach State its largest lead of the game, 52-36. The 49ers were up 62-49 when USC ran off 11 straight points to close to 62-60. Howard hit two free throws and made his fifth 3-pointer of the game in the spurt that saw the Trojans crash the boards and disrupt Long Beach State’s offensive flow.

The 49ers twice extended their lead to six points before USC cut it to 68-66 on Oraby’s dunk.

Caffey answered with the first of the 49ers’ final two baskets to make it 70-66.

USC then scored five in a row to take its first lead, 71-70 since early in the game. Oraby fought off two defenders to score inside, got fouled and made the free throw. Julian Jacobs stole the ball from Caffey near midcourt and scored on a fast-break layup for the lead.

Lamb lost the ball out of bounds near the baseline when it went off his foot, but the Trojans had a shot-clock violation.

MORE NEWS: Three People Injured In Multi-Vehicle Crash In Orange

Caffey took the ball from the opposite end to score the go-ahead layup and USC missed its final two shots.