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.