Former Miami and North Carolina coach Butch Davis told ESPN on Monday that he is leaving the network immediately to accept the head-coaching position at Florida International.

Davis, who has been working as a college football studio analyst since 2014, agreed to a five-year contract. Pete Garcia, FIU's executive director of sports and entertainment, said Davis will be introduced Tuesday afternoon.

"We'll tell you how it happened then," Garcia said.

Garcia said Ron Cooper, who has gone 3-3 as FIU's interim coach, will remain in place for the final two games of this season.

Garcia used Davis as a consultant the last time he hired a coach, Ron Turner, in 2013. Garcia and Davis have a long history, including stints working together with the Hurricanes and then the Cleveland Browns.

Davis spent six seasons as Miami's coach from 1995 through 2000, then left for the Browns -- stepping away from a Hurricanes team that dominated its way to the 2001 national championship under Larry Coker.

When Turner was fired after an 0-4 start this season, Garcia didn't want to consult with Davis this time. He was widely considered to be the immediate front-runner for the position, and now the deal is done.

After two years as an ESPN analyst, former Miami and North Carolina coach Butch Davis is leaving to be head coach at FIU. Robert Willett/Raleigh News & Observer/MCT/Getty Images

Davis also coached for four seasons at North Carolina, getting fired just before the team opened practice for the 2011 season while the school dealt with allegations of improper benefits and academic misconduct. Davis was never implicated in that NCAA probe and has long maintained that he did nothing wrong.

Davis, who will turn 65 on Thursday, will face a rebuilding job at FIU.

FIU went to bowl games in 2010 and 2011 under Mario Cristobal, who was fired in 2012 and is now an Alabama assistant. The Panthers have not been bowl-eligible since, going 16-42 since Cristobal's dismissal.

Some Miami fans lobbied openly last year for the Hurricanes to hire Davis, who acknowledged that he wanted to be considered. Instead, he'll now have a chance to coach against the Hurricanes -- the series between the schools resumes in 2018 and 2019.

It's not the first time Garcia has managed to make a splashy hire to coach at FIU. He landed Isiah Thomas as men's basketball coach in 2009, then fired him three years later after a 26-65 record.

Information from The Associated Press was used in this report.