Six seconds on the clock and Boogie Ellis is on the right wing looking for an opening to attack Washington State’s Tyrell Roberts off the dribble. Four seconds, he crosses Roberts over right to left and begins to drive toward the bucket. Three seconds, he reaches the free throw line and with his heels on the tape and two seconds on the clock, he elevates.

WSU’s DJ Rodman is directly to Ellis’s left, Roberts in front of him. He leans back a bit and somewhat short-arms his shot to keep clear of Rodman’s arm.

With 0.2 seconds left in the game, Ellis’s jumper falls through and the 17th-ranked Trojans escape with a 62-60 victory over the Cougars.

USC had missed five of its previous six shots before the game-winner, but the Trojans—despite trailing for most of the second half—were able to come up with stops at the other end to stay within striking distance. Washington State shot just 32% from the field over the course of the second half.

After taking a 32-28 halftime lead on the strength of Roberts’ and Noah Williams’ 3-point shooting, the Trojans locked in late. Roberts had 12 points on 4-of-6 shooting from deep in the game’s first 20 minutes. Williams added 10 on a perfect 3-for-3 clip from downtown.

In the second half, they were a combined 3-for-8 from the field and 0-of-2 from 3.

Ellis, on the other side, pressed the issue. He attacked, scoring 12 points in the second half and getting to the foul line for five attempts. He finished with a game-high 21 points to lead USC (23-4, 12-4 Pac-12) to a fourth straight win.

After trailing 57-51 with 5:43 to play, USC closed the game on an 11-3 run. Ellis had four during the spurt. Drew Peterson, who finished with 17 points, had a jumper with 4:18 remaining to tie things up at 57-all. Max Agbonkpolo, who finished with 10 points off the bench, hit a triple with 2:15 to play that tied things at 60 apiece, setting USC up for a shot to win it.

“I work hard for those moments,” Ellis said of the game-winner. “It was my first big moment wearing a Trojan uniform, so it was one of the best moments for me.”

Washington State got 16 points from Roberts, 14 from Williams, 12 from Michael Flowers, and a 10-point, 11-rebound double-double from Andrej Jakimovski. Despite going 32% from the field for the game, Washington State shot 15-for-31 from beyond the arc, connecting on a season-high for triples made against the USC defense.

But the Cougars (14-12, 7-8 Pac-12) were just 5-for-32 inside the arc.

USC is back in action on Thursday when it battles Oregon State on the road. The Beavers have lost 12 in a row. Tip-off is set for 8 p.m. PT on ESPN2.

Washington State, which has now lost five straight itself, will look to regain its footing at home against Washington on Wednesday at 8 p.m. PT on ESPNU.