The Trojans (8-3, 5-3 Pac-10) followed Williams' dramatic score by jumping and yelling on their sideline before moving onto the field in unison. They appeared to be taunting the Bruins (6-6, 3-6), who then came across midfield to challenge them before coaches and officials kept them apart.
Allen Bradford ran for 62 yards and two TDs, including a score with 1:30 to play, as the Trojans won Los Angeles' 79th crosstown showdown by rebounding splendidly from the worst defensive performance in USC history.
USC has won three straight over UCLA - allowing just 21 total points - since the Trojans' 13-9 loss to UCLA in 2006. But the long-mighty Trojans staggered into the Coliseum with two blowout losses in their last three games and their lowest ranking since 2001.
The Trojans' defense gave up 47 points to Oregon and a school-record 55 to Stanford in the past three games, but UCLA barely threatened to score until the final minutes. USC constantly rattled UCLA freshman quarterback Kevin Prince, and Will Harris' interception set up Bradford's first TD run early in the second half.
USC limited the Bruins to 180 yards and no points in the first three quarters, more than making up for the Trojans' unabated offensive struggles under Barkley, who passed for 206 yards in his first crosstown game. USC also lost starting tailback Joe McKnight on the first drive of the second half to a thigh injury.
The Bruins barely moved until senior quarterback Kevin Craft relieved Prince, who sprained his right shoulder, in the second half. Fullback Chane Moline scored their only TD on a 2-yard direct snap with 5:41 to play.
But Barkley then made perhaps his best throw, hitting Ronald Johnson with a 20-yard pass on third down with less than 2½ minutes to play. Bradford rumbled 21 yards to the UCLA 2 on the next play before scoring.
USC's defense then took over on downs near midfield with 54 seconds left, sealing the Trojans' 10th win in the last 11 meetings - and setting up Williams' long TD catch, followed by the late theatrics that had UCLA's coaches sending their players to the locker room without the customary postgame handshakes.
Craft passed for 98 yards and Prince had 90 for the Bruins, whose three-game winning streak ended. The Bruins are bowl-eligible, but they're the seventh-place team in a strong conference with just six automatic bowl affiliations.
Both teams marched into the Coliseum wearing their home jerseys, a long-dormant tradition revived last season by USC at the Rose Bowl. UCLA even went a step further with the powder-blue 1967 throwback jerseys that the Bruins first wore in a win over Washington three weeks earlier to snap a five-game skid.
But all the color was in the uniforms, not the dull play. USC led 7-0 after a 10-punt first half, the rivalry's lowest-scoring first half in 33 years.
Prince made the half's biggest mistake when he lost sight of Smith, throwing a short slant pass right into the USC linebacker's numbers in the first quarter. Smith outran Prince down the UCLA sideline, showing off the speed he shares with his brother, former Trojans receiver Steve Smith.
Most of the fans in the non-sellout Coliseum crowd wore multiple sweaters and scarves for a television-mandated nighttime edition of the rivalry game, traditionally an afternoon affair.
The chilly temperatures didn't phase a row of USC students who had each painted one character of "WE RUN LA!" on their chests in the front row of the student section.