The trap was laid, just like it had been many times before. Another USC football team with title potential driving toward destiny, only to take a dangerous detour through the Willamette Valley to Oregon State, where nothing ever seems to go as planned for the Trojans.

It’d been a decade since their last defeat here, but the specter of those ill-fated trips still loomed, years of bad voodoo coursing through these half-finished bleachers. The four terrible turnovers in 2006. The Jacquizz Rodgers game in 2008. Both losses stunningly slammed the door on the Trojans’ national title hopes, leaving USC haunted about what might have been.

Those devastating disappointments seemed a fitting prelude as No. 7 USC entered Saturday’s final Pac-12 trip to Corvallis with similar, sky-high hype, soaring up the polls and into the playoff conversation, only to run headlong into a brick wall against the Beavers.

Somehow, some way, the Trojans still managed to emerge unscathed, escaping with a 17-14 victory and exorcising their demons while keeping their undefeated start intact.

Before its final, last-ditch drive, nothing seemed to be working for USC. An offense that appeared unstoppable through three games suddenly couldn’t move the ball. And quarterback Caleb Williams, after a stellar start to the season, was coming apart at the seams.

But after a long, ugly night, it came down to Williams, the star quarterback, who had one fortuitous chance to wipe away all that had come before this moment.

It’d been a precarious drive to that point. One pass dropped. Then another. Faced with a do-or-die fourth down, Williams rumbled ahead himself, just barely finding the first-down marker. Bit by bit, USC scratched and clawed its way down the field.

Then, with slightly more than a minute remaining, Williams spotted Jordan Addison streaking along the sideline and let it rip. The ball arrived just in time, missing a sprinting safety and finding Addison in perfect position for a 21-yard, go-ahead score.

That 11-play touchdown drive proved just enough, thanks largely to USC and its opportunistic defense, which reeled in a fourth and final interception, courtesy of Max Williams, to put away Oregon State (3-1, 0-1 Pac-12) in the final seconds.

USC (4-0, 2-0) didn’t have a turnover for the fourth consecutive game, but tried to give the game away on several occasions. Williams put together perhaps the most woebegone effort of his college career, finishing 16 for 36 for 180 yards and a touchdown.

If it weren’t for a Herculean effort from Travis Dye, who racked up 133 yards and a touchdown on 19 carries, it’s unclear whether USC’s offense would’ve been able to move the ball at all.

Saturday night didn’t start off on the right foot. After a 36-yard scamper by Dye, USC came up empty on its next three plays, then fell short on fourth down for the first time this season. It also was the first opening drive that didn’t yield a touchdown for the Trojans under coach Lincoln Riley.

Their second drive wasn’t much better. Dye dragged USC’s offense down the field largely by himself, while the Trojans struggled to find any semblance of rhythm. Through two drives, Dye had 70 yards while Williams had completed just one of six passes for 11 yards. Both USC possessions were fruitless, as Denis Lynch missed a 36-yard field goal.

Soon enough, the Trojans were trailing for the first time this season, as Deshaun Fenwick barrelled into the end zone for a five-yard score.

Faced with its first major dose of adversity, USC’s usually dynamic offense looked out of sorts. Seemingly simple throws from Williams sailed high, dove into the dirt or arrived late and behind his receivers. The quarterback ended the first half just six for 18 for 64 yards, his worst half of the season.

A takeaway briefly saved USC from a crushing momentum swing late in the second quarter as Eric Gentry picked off Beavers quarterback Chance Nolan. The Trojans were able to muster just enough to get Lynch into range for a 42-yard field goal, the only points of the half for one of the nation’s highest-scoring offenses.

There would be no magic elixir for what ailed USC’s offense awaiting in the locker room. Upon their return, the Trojans sent the kickoff out of bounds. They fumbled inside their own one-yard line on the ensuing possession. When USC finally found a way to move the ball, Williams took a third-down sack that knocked the Trojans out of range.

It took another big play from USC’s defense to get back in striking distance, as Ceyair Wright picked off Nolan to give the Trojans the ball with just 26 yards to go. They nearly squandered that opportunity too, until Dye broke through a crowd on fourth and two and scored.

That score for a 10-7 lead early in the fourth seemed like it might spark the Trojans. Especially as Mekhi Blackmon added his own pick on the Beavers’ next drive. But Williams and Co. stalled again inside their own five, and a 33-yard punt put Oregon State back in prime position.

It took all of two plays for Oregon State to capitalize on an 18-yard touchdown run by Jam Griffin. But with almost five minutes left, USC found a way to go 84 yards in 11 plays, and save the day, in spite of its own performance.

©2022 Los Angeles Times. Visit at latimes.com. Distributed by Tribune Content Agency, LLC.