Gainesville, FL (SportsNetwork.com) - After a minor hiccup, Jim McElwain will leave Colorado State to become the new football coach at Florida.

McElwain was named to the position Thursday and will take over for Will Muschamp, who guided the Gators for the past four seasons.

"Coach McElwain was someone we targeted from the beginning of the search," said Florida athletic director Jeremy Foley in a statement Thursday. "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."

Florida officials, led by Foley, flew to Fort Collins, Colorado this week to speak with McElwain and a statement from the university on Wednesday said there were "very productive conversations."

However, an issue over McElwain's $7.5 million buyout with Colorado State developed. It was resolved early Thursday morning.

According to the Gatorzone.com website, Colorado State will receive a payment of $3 million over six years from the Florida Athletic Association and McElwain has agreed to pay Colorado State $2 million over time. The Gators and Rams will also play a game in Gainesville between 2017-20 with a $2 million guarantee.

McElwain led Colorado State to a record of 10-2 this season and was named the Mountain West's top coach. He has amassed a mark of 22-16 in three years as the Rams' head coach.

After an eight-win season and a victory in the New Mexico Bowl last year, he was rewarded with a three-year extension through the 2019 season.

McElwain fits the profile of the offensively oriented coach Foley publicly stated he was seeking to replace the defensive-minded Muschamp. Colorado State ranks seventh in FBS in passing offense (326.3) and has averaged 497.8 total yards per game this season.

The 52-year-old coaching veteran is familiar with the SEC, having spent four seasons from 2008-11 as the offensive coordinator at Alabama. The Crimson Tide won a pair of national championships during his tenure.

"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 added. "He has recruited the south and the state of Florida and has spent time coaching at the highest level in the NFL."

Before his time at Alabama, McElwain was also the offensive coordinator at Fresno State in 2007 and also spent time as a collegiate assistant at Michigan State (2003-05), Louisville (2000-02), Montana State (1995-99) and Eastern Washington (1985-94). He was the quarterbacks coach of the NFL's Oakland Raiders in 2006.