Jim McElwain's representatives and Colorado State have cleared up the issues surrounding his buyout, and McElwain has agreed to become the next head coach of the Florida Gators.
The coach, who will be introduced at a news conference Saturday, will be paid an average of $3.5 million per season over a six-year contract, according to sources.
"Coach McElwain was someone we targeted from the beginning of the search," Florida athletic director Jeremy Foley told the school's official website. "The more we worked through the process and did our due diligence, coupled with our meeting and conversations with him and those around him, it was obvious he is the right person to lead the Florida Gator football program."
To settle the dispute over McElwain's $7.5 million buyout, Florida agreed to pay $3 million over six years to Colorado State and also agreed to a future game -- with a $2 million guarantee -- in Gainesville sometime between the 2017 and 2020 seasons, sources told ESPN's Brett McMurphy.
In addition, McElwain has agreed to pay $2 million to Colorado State over time, sources told McMurphy.
The $5 million being paid from Florida to Colorado State marks the largest school-to-school buyout ever.
McElwain, 52, was in his third season at Colorado State. The Rams (10-2) have won 16 of their last 20 games dating to last season. That's after losing 27 of 36 games in the three seasons prior to McElwain's arrival in 2012.
An emotional McElwain, who was named Mountain West Conference Coach of the Year on Tuesday, met with his team and assistants one final time Thursday in the auditorium where he's gone over many a game plan. There was a roar from inside the room before McElwain exited in tears.
McElwain hasn't finalized his staff, but he does expect to interview some of the Gators' current assistants, sources said.
Foley was looking for somebody with a strong offensive background, and McElwain fits that bill.
"He has a proven track record on the offensive side of the ball, has coached in the SEC, won two national championships and has had success as a head coach," Foley told the school's website. "He has recruited the South and the state of Florida and has spent time coaching at the highest level in the NFL.
"He has an engaging personality and is someone who can connect with a variety of audiences, and he operates with a high level of integrity. I welcome him and his family to The Gator Nation, and I'm looking forward to working alongside him and his staff as they build a championship program both on and off the field."
The Rams are 13th nationally in total offense (497.8 yards per game) and have the country's second-most efficient quarterback in Garrett Grayson, who has thrown 32 touchdown passes and only six interceptions. Colorado State's top receiver, Rashard Higgins, leads the country in receiving yards per game (149.1) and receiving touchdowns (17). The Rams scored more than 30 points in eight of their 12 games this season and are one of two Group of 5 teams with two wins over Power 5 teams, defeating Boston College and Colorado.
"He couldn't turn down this job," Colorado State senior guard Mason Myers said. "We know. We seniors know how it works."
It didn't take McElwain long to transform Colorado State into an offensive powerhouse. In his second season, the Rams went from 100th nationally in scoring offense to 22nd and from 100th in total offense to 24th.
"We wish him well and are confident we can recruit a coach who is committed to a sustained program of excellence at Colorado State over the long term," CSU president Tony Frank said.
Colorado State offensive coordinator Dave Baldwin will step in as interim coach for the Rams' upcoming bowl game.
McElwain replaces Will Muschamp, whose Gators never finished higher than 90th nationally in total offense in his four seasons in Gainesville. Muschamp was fired last month after going 10-13 over the past two seasons.
Originally from Montana, McElwain tutored first-year starting quarterbacks (Greg McElroy and AJ McCarron) in two of his four seasons as Alabama's offensive coordinator. The Crimson Tide were known for their offensive balance under McElwain.
McElroy, who is currently an SEC Network analyst, congratulated Florida, saying the school has the "real deal" in McElwain.
In McElwain's final season at Alabama in 2011, the Tide were the only team in the SEC that averaged more than 200 rushing yards and 200 passing yards per game on their way to what was then coach Nick Saban's second national championship in Tuscaloosa.
ESPN's Brett McMurphy, ESPN.com's Darren Rovell and The Associated Press contributed to this report.