STANFORD, Calif. -- No. 25 Notre Dame put itself in position for an upset, but Stanford's standout defense responded when it mattered most, enabling the No. 8 Cardinal to hold off the Irish 27-20 on Saturday night at Stanford Stadium.
Running back Tyler Gaffney ran for 189 yards for Stanford, which improved to 10-2, ensuring that it will finish with at least 10 wins for the fourth straight season.
"You have to say it now, we are amongst the elite, to have this many 10-win seasons in a row," Stanford coach David Shaw said.
The Cardinal's defensive effort in the fourth quarter -- highlighted by cornerback Wayne Lyons' two interceptions in the final six minutes -- preserved the 10th win and sent the Irish to a disappointing loss.
"No moral victories," Notre Dame coach Brian Kelly said. "We're very disappointed we didn't come up a play to win the football game."
Stanford will play Arizona State in the Pac-12 championship game next Saturday, and made sure it will carry some momentum into that game by holding on after the Irish (8-4) reduced a 21-6 deficit in the third quarter to 24-20 entering the fourth quarter.
The only score in the fourth quarter was a 28-yard Jordan Williamson field goal for Stanford, as Notre Dame was shut out in the final 15 minutes.
"We wanted to get to the fourth quarter to have a chance to win the game," Kelly said, "and we got to the fourth quarter with a chance but didn't make the plays we needed to make."
Notre Dame trailed 27-20 when Lyons picked off a pass from Notre Dame quarterback Tommy Rees at the Cardinal 41-yard line with 5:51 remaining.
The Irish defense forced a punt to get one more opportunity, starting at the Notre Dame 21 with 3:35 left. But Lyons made a second interception at the Stanford 30 with 2:24 to go.
"We'll take our defense against any team," said Stanford quarterback Kevin Hogan, who was 12-for-18 for 158 yards and a touchdown but threw two interceptions.
The Cardinal got one first down after that on Gaffney's 18-yard run and was able to run out the clock.
Stanford won despite adding just six points after scoring its third touchdown early in the third quarter.
"When we get the lead, we don't mind if you know it, it's going to be the offensive line, Tyler Gaffney and great defense," Shaw said.
The loss wrapped up Notre Dame's regular season. The Irish will play in a postseason game, although the bowl game and the opponent have yet to be determined.
"There'll be some opportunities we'll have to sit down and evaluate," Kelly said. "We'll be appreciative of any bowl that would take a good, hard look at us."
Bowls would have taken a closer look if the Irish had pulled off the upset. Rees had an inconsistent performance, finishing 16-for-34 for 199 yards, two scores and the two late interceptions.
Stanford increased a 14-6 halftime lead to 21-6 by scoring on its first possession of the third quarter. Anthony Wilkerson finished the 76-yard drive with a 20-yard touchdown run on a third-and-9 play.
Notre Dame cut the deficit to 21-13 on Rees' 4-yard touchdown pass to T.J. Jones, which completed a 61-yard scoring drive.
Gaffney's apparent touchdown run was nullified by a holding penalty on Stanford's ensuing possession, and the Cardinal had to settle for a 27-yard Jordan Williamson field goal to increase their lead to 24-13.
Notre Dame closed the gap to 24-20 on Rees' 14-yard touchdown pass to wide receiver DaVaris Daniels with 1:37 left in the third quarter.
Williamson's 28-yard field goal put the Cardinal ahead 27-20.
The Irish were unable to convert their first-half chances into touchdown, having to settle for two field goals.
Notre Dame scored first, driving 65 yards to the Stanford 4 before Kyle Brindza kicked a 21-yard field goal to give the Irish a 3-0 lead.
Stanford went ahead 7-3 with a touchdown on its first possession. Hogan finished the 75-yard drive with a 16-yard touchdown pass to wide receiver Devon Cajuste. The Cardinal never relinquished the lead.
NOTES: If Arizona beats Arizona State on Saturday night, Stanford will host Arizona State in the Pac-12 title game next Saturday. If Arizona State beats Arizona, the Sun Devils will host Stanford in that game. ... Notre Dame's S Eilar Hardy and S Elijah Shumate did not travel with the team for Saturday's game because of violations of team rules. One of the two was scheduled to start at safety. ... Stanford has won 16 straight home games, the second longest active streak in the country. South Carolina won its 18th straight home game by beating Clemson. ... Stanford DT Josh Mauro had to leave the game with a leg injury. He is questionable for next Saturday's game. ...Irish C Nick Martin (knee) and DT Louis Nix III (knee) did not play Saturday and will miss Notre Dame's bowl game. ... Notre Dame is the fifth ranked team that Stanford faced this season at Stanford Stadium. The Cardinal beat the previous four. ... Notre Dame beat Stanford 17-10 in overtime last season in a game that ended in controversy. Cardinal RB Stepfan Taylor was ruled to have been stopped short of the end zone on a fourth-down run that would have tied the score in overtime. Stanford thought Taylor crossed the goal line. Officials ruled the whistle had blown earlier.