(AP) - Iowa and Stanford barely missed out on the College Football Playoff.

The Rose Bowl is a pretty great place to forget your sorrows.

The sixth-ranked Hawkeyes (12-1) will face the No. 5 Cardinal (11-2) on New Year's Day in the 102nd edition of the Granddaddy of Them All.

More from FoxSports

Iowa and Stanford finished in the final two spots outside the four-team playoff, yet they earned coveted spots in the traditional year-end intersectional matchup between the Big Ten and Pac-12 powers.

''If this is the consolation prize, what a deal it is for both of us,'' Iowa coach Kirk Ferentz said.

Even though the Hawkeyes lost their unbeaten season and the Big Ten title game to Michigan State on a late touchdown Dec. 5, they still held off Ohio State to earn their first trip to Pasadena since Jan. 1, 1991. Ferentz will cap his 17th season at Iowa with his first Rose Bowl appearance as a head coach.

''This news is good medicine, I think, for all of us, just to ease the tough outcome,'' said Ferentz, the offensive line coach on two Rose Bowl teams at Iowa in the 1980s.

While the Hawkeyes hadn't made the Rose Bowl in a generation, Pasadena has become a second home for Stanford coach David Shaw's improbable Bay Area powerhouse.

The Cardinal earned their third Rose Bowl berth in four years by beating then-No. 24 Southern California 41-22 in the Pac-12 title game Dec. 5. Stanford beat Wisconsin three years ago to earn its first Rose Bowl victory since the 1971 season, but lost to Michigan State two years ago.

''We too are excited about going back to Pasadena,'' Shaw said. ''The Rose Bowl people have been phenomenal the times that we've gone. That's a rare occurrence nowadays, but we're looking forward to the week, looking forward to a great game.''

Stanford also had hopes of a playoff spot after finishing the season with big wins over then-No. 4 Notre Dame and USC, but conference title game victories by Clemson and Alabama consigned the Cardinal to Pasadena.

Although both football programs date to the 19th century, Iowa and Stanford have never faced each other. Shaw and Ferentz have only a passing acquaintance, but both coaches have watched the other's program occasionally through the season.

''I loved what Iowa did during the course of this year as being one of those under-the-radar teams that kept winning ... and finally people started to notice the phenomenal job that was going on,'' Shaw said. ''I love well-coached teams that fight and scrap and eventually get what they deserve.''

Cardinal running back and Heisman Trophy runner-up Christian McCaffrey will cap his incredible season with his first appearance in the Rose Bowl game. The 19-year-old sophomore has gained more yards in a season than anybody in the history of college football with 3,496, breaking Barry Sanders' record of 3,250 set in 1988, while racking up a school-record 461 total yards against the Trojans.

''That's a guy I had posters on my wall of growing up,'' McCaffrey said. ''Even to be mentioned in the same category is definitely an honor.''

He also threw a touchdown pass, caught a touchdown pass and rushed for another score against USC. Shaw called McCaffrey ''the best player in the nation. It's not even a debate. I don't know if that's even a question. There's nobody in the nation doing what he's been doing.''

While McCaffrey has spent the season running wild behind Stanford's imposing offensive line, Iowa also has a vaunted running game built around four carriers: Jordan Canzeri, LeShun Daniels Jr., Derrick Mitchell Jr. and Akrum Wadley.

Canzeri, who led the team with 976 yards and 12 TDs, calls them the ''Four Deadly Horsemen,'' and the Hawkeyes ran for at least 100 yards in every game.

Although it took 25 years for Iowa to get back to Pasadena, it's been even longer since the Hawkeyes could celebrate a victory. They haven't won the Rose Bowl since Jan. 1, 1959, when the Big Ten champions beat California and were named national champions by the Football Writers Association of America. Famed coach Hayden Fry never won the Rose Bowl, losing each of his three Big Ten championship teams' trips to Pasadena before Ferentz replaced him in 1999.

The Pac-12 has sent just three different teams to the Rose Bowl in the past 13 years: USC, Oregon and Stanford, which is making its 15th Rose Bowl appearance. The school hadn't made three Rose Bowl trips in four years since 1933-35, when Stanford played in three straight.

Iowa is the seventh different Big Ten team to play in Pasadena in the past 13 years, with Wisconsin and Michigan making three appearances apiece.

''(Shaw's) been part of a long-lasting run of success there,'' Ferentz said. ''They have done a great job underneath him. So, it's going to be a great challenge for us. I know that.''