USC robbed crosstown rival UCLA of the chance to celebrate a Pac-12 title on the Trojans' court when Jonah Mathews drilled a 3-pointer with one second left to down the Bruins 54-52.

UCLA (19-12, 12-6 Pac-12) trailed most of the second half until taking a 52-51 lead on a pair of free throws from Cody Riley with nine seconds left. Then, Mathews dribbled down the court with the final seconds ticking away and used a pick at the top of the key to get enough space for a shot. He drilled it from the left wing to secure the victory.

The win was the third straight for the Trojans (22-9, 11-7), and it lifted USC to a regular-season sweep of the Bruins. UCLA could still take a share of the conference title if Oregon loses to Stanford.

UCLA had won seven straight entering the game as it recovered from a 1-3 start in conference play to take sole possession of first place in the Pac-12. But even after the remarkable recovery, the Bruins are on the bubble, according to CBS Sports Bracketology expert Jerry Palm.

The Bruins will be the No. 2 seed in the Pac-12 Tournament, regardless of whether they share the regular-season title with Oregon since the Ducks won their only head-to-head meeting. That means UCLA's first game in the event will come Thursday at 9 p.m. ET.

With the win, USC put itself in contention for a first-round bye as well. The Trojans will learn their seeding in the bracket after the league's final regular-season games conclude on Saturday.