Matt Slocum/Associated Press

The Indianapolis Colts thought New England Patriots offensive coordinator Josh McDaniels would be their next head coach, but Sunday they settled on someone who beat him in the Super Bowl.

Indianapolis confirmed it has agreed to a deal with Frank Reich, who spent the last two seasons as the offensive coordinator of the Philadelphia Eagles.

“We are extremely excited to announce Frank Reich as head coach of the Indianapolis Colts,” Colts owner Jim Irsay said in the team release. “Frank has all the ingredients of a successful head coach: intelligence, innovation, character, organizational and leadership skills, and a commanding presence. He also has a stellar reputation, and his myriad of life experiences and the people he has worked with make him the perfect fit for us and our fans. I feel extremely fortunate and could not be more excited for Colts Nation and the future of our franchise."

NFL Network's Mike Garafolo first reported the deal, noting Reich signed a five-year contract. Reich was an offensive assistant for the Colts from 2008 through 2011.

On Wednesday, Adam Schefter of ESPN reported Indianapolis would interview Reich on Friday. McDaniels had elected to stay with the Patriots on Tuesday instead of taking the Colts position.

Reich's Eagles finished third in the league in scoring and seventh in yards in 2017.

While those numbers are impressive, what stands out is he helped the team win the Super Bowl after Carson Wentz tore his ACL in December. Nick Foles stepped in and threw for 352 yards and three touchdowns in a win over the Minnesota Vikings in the NFC Championship Game and 373 yards and three touchdowns in a win over the Patriots in the Super Bowl.

Foles had 10 touchdown passes and 10 interceptions for the St. Louis Rams and Kansas City Chiefs in 2015 and 2016, but Reich helped turn him into the Super Bowl MVP. Wentz had been an MVP candidate, and the Eagles' chances for their first Super Bowl title appeared to evaporate when he was injured.

Landing Reich was notable for the Colts after the McDaniels drama. The team said it was "surprised and disappointed" when McDaniels decided to stay with New England "after agreeing to contract terms" with Indianapolis.

According to Mike Reiss of ESPN.com, McDaniels elected to remain with the Patriots following a meeting with Bill Belichick during which the head coach said he would become more of a mentor to McDaniels.

"It is an arrangement that owners Robert and Jonathan Kraft endorsed because it could ultimately be part of a succession plan for Belichick, although no assurances were made to McDaniels," Reiss wrote.

With McDaniels off the table, Indianapolis turned its attention toward Reich. The Colts offense ranked an abysmal 31st in the league in yards and 30th in points in 2017. To be fair, a large reason for the lack of production was the fact quarterback Andrew Luck was sidelined for the entire campaign with a shoulder injury.

When healthy, he is one of the best quarterbacks in the league. Luck made three Pro Bowls in his first three seasons and led the NFL with 40 touchdown passes in 2014.

Considering what Reich did with Foles on the sport's biggest stage, it's likely easy for Colts fans to envision a high-flying offense with Luck at the helm.

The Colts needs better offensive showings moving forward if they are going to compete in the AFC South, which featured playoff teams in the Jacksonville Jaguars and Tennessee Titans in 2017. The Houston Texans could also be a threat in 2018 if Deshaun Watson and J.J. Watt return to full health and don't miss too many games. Indianapolis has missed the playoffs in each of the last three seasons, and it will be up to Reich to change that pattern.