Rex Ryan says Mike McCarthy is going into a great situation in Dallas, but he doesn't believe McCarthy is the long-term solution at head coach for the Cowboys. (1:33)

FRISCO, Texas -- Mike McCarthy will be the ninth head coach in the history of the Dallas Cowboys, a source confirmed to ESPN.

McCarthy's contract with the Cowboys will be for five years, according to a source.

New Orleans Saints linebackers coach Mike Nolan will be the Cowboys' defensive coordinator under McCarthy, a source told ESPN, confirming a report by NFL Network. McCarthy was the offensive coordinator on Nolan's San Francisco 49ers staff in 2005 before being hired by the Green Bay Packers as head coach in 2006. Nolan, 60, has served as defensive coordinator for several NFL teams, most recently the Atlanta Falcons from 2012 to 2014.

McCarthy stayed at the home of Cowboys owner/general manager Jerry Jones on Saturday night, a source told ESPN's Adam Schefter.

"Once you stay at Jerry's house, he doesn't lose his guy," the source said.

McCarthy replaces Jason Garrett, who went 85-67 as Dallas' coach from 2010 to 2019, with the team hoping that McCarthy can do for the Cowboys what he did for another storied franchise -- win a Super Bowl.

Cowboys' Cure for Close Losses? The Cowboys couldn't win the close games this season, going 1-6 in one-possession games, the second-worst record in the NFL behind the Bengals (0-8). Mike McCarthy could turn that around. Since 2006, McCarthy has won 58 games that were decided by eight or fewer points, the fourth-most by any coach during that span. Coach Wins in 1-Poss. Gms* Mike Tomlin 72 Bill Belichick 68 Sean Payton 62 Mike McCarthy 58 *Since 2006

-- ESPN Stats & Information

In February 2011, McCarthy led the Packers to a Super Bowl XLV win against the Pittsburgh Steelers at AT&T Stadium, his new home with the Cowboys.

McCarthy compiled a 125-77-2 record with the Packers and made the playoffs in nine of his 13 seasons. In addition to the Super Bowl season, the Packers made it to the NFC Championship Game two times, but his tenure ended sourly, missing the playoffs in 2017 and getting fired after 12 games in 2018.

McCarthy spent last season going through a study of trends across the league while also planning for his next job. He interviewed for the New York Jets' vacancy after the 2018 season and turned down the chance to speak with the Tampa Bay Buccaneers and Arizona Cardinals.

Before interviewing with the Cowboys over the weekend, he spoke with the Carolina Panthers, Cleveland Browns and New York Giants regarding their vacancies.

The approach by Jones and son Stephen, the Cowboys' executive vice president, was far different from the last full-scale coaching search they had in 2007, after Bill Parcells' retirement. They interviewed 10 coaches before settling on Wade Phillips, who was hired after Garrett was on board as offensive coordinator.

This time, the Cowboys interviewed just Marvin Lewis and McCarthy before making their decision.

McCarthy's arrival will bring an entirely new offense to the Cowboys after running mostly a Garrett scheme since 2007, even though the team has had three different playcallers since 2013 -- Bill Callahan (2013), Scott Linehan (2014 to 2018) and Kellen Moore (2019).

Moore, offensive line coach Marc Colombo, quarterbacks coach Jon Kitna and receivers coach Sanjay Lal are under contract. Most of the defensive staff, including coordinator Rod Marinelli and passing game coordinator Kris Richard, have expiring contracts.

McCarthy played a key role in the development of Packers quarterback Aaron Rodgers, and the Cowboys believe he will be good for Dak Prescott, who is entering his fifth season. Perhaps of note to the Jones family, McCarthy had a 7-3 record against Dallas while with Green Bay and twice ended the Cowboys' season in painful ways, in the divisional round of the 2014 and '16 playoffs.

In 1993, McCarthy entered the NFL coaching ranks as an offensive assistant with the Kansas City Chiefs. From 1995 to 1998, he served as the Chiefs' quarterbacks coach before moving on to Green Bay for a season as a quarterbacks coach. From 2000 to 2004, he served as offensive coordinator for the Saints and had the one-year run in the same job with the 49ers in '05 before becoming the Packers' head coach.

In Green Bay, he dealt with the shadows of championship coaches Vince Lombardi and Mike Holmgren. In Dallas, he will deal with the shadows of championship coaches Tom Landry and Jimmy Johnson.

Fox Sports first reported the news of McCarthy's hiring.