It all seemed eerily similar. The feeling afterward was much different.

Thirteen days before, Anthony Brown scored a rushing touchdown in the fourth quarter to give Oregon a 24-17 lead. Thirteen days before, the Ducks committed defensive penalties as the opposition drove to a potential game-tying score in the final seconds. Friday night for Oregon against California, the final minutes were playing out just as they had 13 days before at Stanford.

But the Ducks lost that game in overtime, after the Cardinal scored to end regulation. Friday night was different, as No. 9 Oregon made a successful goal-line stand to beat the Golden Bears, 24-17, and improve to 5-1 on the season, 2-1 in Pac-12 play.

"We weren't going to have that same feeling we had at Stanford," UO safety Verone McKinley III said. "We were going to close this game out."

Though the Ducks welcomed offensive coordinator Joe Moorhead back for Friday's game after he missed the Stanford loss due to illness, the UO offense struggled much of the night to capture any rhythm. Cal took advantage, and rallied into a 17-10 lead early in the fourth quarter.

But Brown tied the game with a touchdown pass to Jaylon Redd with 11:23 to play. Then, the UO quarterback rushed for the go-ahead touchdown with 4:50 left in the game.

"AB is our guy," UO center Ryan Walk said after Brown finished 20-of-28 passing for 244 yards and a touchdown, with 44 rushing yards and another TD. "We're going to roll with him. He's our leader."

As was the case at Stanford, penalties on the UO defense fueled a last-minute drive to a potential game-tying score by California. But Oregon's pass rush, sparked by the second-half impact of Kayvon Thibodeaux following his first-half suspension for targeting at Stanford, forced Cal QB Chase Garbers to throw incomplete on five of his last six attempts, including on fourth-and-goal from the UO 3-yard line with 5 seconds left.

"Just a really gutsy performance," UO coach Mario Cristobal said. "It was a battle; our battles with Cal over the years have been really tight football games, and this was another one."

The Ducks won despite the absence of leading rusher CJ Verdell following the season-ending injury he suffered at Stanford, and despite playing for the second straight game without center Alex Forsyth due to injury. Travis Dye stepped up in the absence of Verdell and not only led the Ducks with 19 rushes for 145 yards and a touchdown, but also seven receptions for 73 yards.

Dye's rushing touchdown gave the Ducks a 10-7 lead in the second quarter, adding on after Camden Lewis hit a 49-yard field goal in the first quarter. It was still 10-7 at halftime, and though Cal scored 10 straight to open the second half, Oregon rallied back into the lead and held on in the final seconds.

Cristobal said Dye addressed the team prior to the opening kickoff.

"His style of play, his energy, his leadership, which has really stood out all week long, made a tremendous impact," Cristobal said, adding of his pregame speech: "His message was strong and from the heart, and I think it really carried through and showed in the fourth quarter."

The first-quarter field goal by Lewis was necessary after a holding penalty negated a third-down conversion that would have put the Ducks in the red zone. Later in the first quarter Oregon turned it over on downs in Cal territory, and the Ducks lost two fumbles in the second quarter.

Despite those breakdowns, Oregon led at halftime. But the Ducks were held scoreless in the third, then saw Cal rally into the lead with 13:37 left in the game.

The next four possessions kept alive Oregon's College Football Playoff aspirations. Following Cal's go-ahead touchdown, the Ducks exploded down the field with a five-play, 62-yard scoring drive capped by Redd's TD reception. A sack by Thibodeaux backed up the Golden Bears on their next possession, and they had to punt. Again the Ducks roared down the field, going 70 yards in seven plays to take the lead on Brown's rushing touchdown.

"We came out and we were physical on those couple drives," Walk said. "And we went down and finished them. We didn't shoot ourselves in the foot like we did in the first half."

Cal's ensuing possession appeared to end on a fourth-down incompletion after six plays, but the drive was extended after Oregon was flagged for holding. Another holding call on the UO secondary moved the ball inside the 10-yard line with less than a minute to play.

A run stop by Brandon Dorlus and a quarterback hurry by Keyon Ware-Hudson set up another fourth down for the game, but Garbers kept the drive alive by completing a shovel pass to move the chains despite being wrapped up by Thibodeaux. A spike to stop the clock, an incompletion with 10 seconds left and a run stuffed by Bradyn Swinson and Noah Sewell set up another fourth down. The Ducks brought a massive pass rush, and Sewell was credited with hurrying Garbers into one last incompletion.

For a few harrowing moments, it seemed like recent history was repeating itself. But this time, the Ducks made the final play, and held on to win.