Wolverines coach Jim Harbaugh announced the addition to his staff Tuesday.
At Florida, the 55-year-old McElwain became the first coach in SEC history to lead his team to the SEC championship game in each of his first two seasons in 2015 and 2016, but the Gators lost both times to Alabama.
In late October, following a 42-7 loss to Georgia -- the Gators' third straight loss -- McElwain was fired. Earlier that week, McElwain disclosed in his weekly news conference that members of his family had received death threats, but he declined to provide specifics to school officials because he didn't want to drag his family and others through further controversy.
Florida officials notified McElwain's agent that the university intended to fire McElwain for cause because he didn't alert school officials to the threats, but the two sides later reached a $7.5 million buyout. That buyout was unmitigated, meaning it won't be impacted by what McElwain is paid at Michigan.
Before taking the Florida job, McElwain resurrected Colorado State's program by leading the Rams to 18 wins over his last two seasons. McElwain was also the offensive coordinator at Alabama under Nick Saban on both the 2009 and 2011 national championship teams.
The Wolverines previously hired Sherrone Moore to coach tight ends, Al Washington to be an assistant on defense and Ben Herbert to lead the team's strength and conditioning program.
Michigan was 8-5 last year after having 10-2 records in each of Harbaugh's first two seasons.
ESPN's Chris Low and The Associated Press contributed to this report.