SEATTLE — For all he’s accomplished in his Oregon career, Justin Herbert had never faced the challenge of rallying from this much of a deficit, on the road and against the Ducks’ most hated rival.

Doing so would all but lock up the Pac-12 North, keep Oregon on the very fringes of the College Football Playoff conversation and put a nail in Washington’s hopes of repeating as conference champs.

“I don’t even think we did that in high school. It was a lot of fun today and glad we got the win,” Herbert said.

Herbert capped Oregon’s rally from a 14-point second-half deficit with a 5-yard TD pass to Jaylon Redd with 5:10 left, and No. 12 Oregon rallied to beat No. 25 Washington 35-31 on Saturday.

What was expected to be a defensive showdown turned into an offensive shootout with both Herbert and Washington quarterback Jacob Eason taking the spotlight.

Eason was great.

Herbert was better.

Down 28-14 after Puca Nacua caught a 33-yard TD pass from Eason on the opening drive of the second half, Oregon’s touted defense finally showed up and gave Herbert a chance to rally the Ducks. The Ducks pulled within 31-28 on the final play of the third quarter when a well-designed screen pass on fourth-down found Mycah Pittman, and the freshman raced untouched 36 yards for the score.

The Ducks defense forced consecutive three-and-outs, and Oregon marched its way to the go-ahead score. Between Travis Dye and Cyrus Habibi-Likio, the Ducks went 70 yards in 31/2 minutes, and Herbert found Redd in the flat for the final 5 yards and the lead. It was the last of Herbert’s four TD tosses.

“We talk about the harder it gets the better we play and that showed up in the second half,” Oregon coach Mario Cristobal said.

Herbert finished 24 of 38 for 280 yards. He threw TDs of 12 yards to Spencer Webb and 16 yards to Redd in the first half.

The victory gave Oregon (6-1, 4-0 Pac-12) complete control in the North Division. Four of the five other teams already have three conference losses, with Oregon State at 2-2 the closest to the Ducks.

Washington (5-3, 2-3) reached the Oregon 38 with 21/2 minutes left, but Eason was sacked on second and 6 by Popo Aumavae and lost 12 yards. It was the first sack of the game by either team.

The Huskies faced third and 23 after a false start but got 20 yards back on a pass to Marcus Spiker. On fourth and 3, Eason’s pass for Nacua was high and the Ducks celebrated a second straight win over their rivals.