The winningest coach in Michigan basketball history is headed to the NBA.

A year after flirting with the idea of coaching the Detroit Pistons, John Beilein has agreed to coach the Cleveland Cavaliers. The news was first reported by ESPN on Monday morning, stating Beilein, 66, has agreed to a five-year deal with the organization.

Beilein told Michigan this morning he was for sure leaving to go to Cleveland, according to a source with knowledge of the conversations. He then began telling his players. There are no immediate plans in place to replace him.

The move ends one of the most impressive runs in Michigan basketball history, as Beilein went 278-150 over a 12-year span that included two trips to the national title game, two Big Ten titles and two Big Ten Tournament titles.

THRILLER! Inside Kawhi Leonard's historic buzzer-beater that lifted Raptors

PORZINGIS:Dallas Mavericks star involved in altercation at club in Latvia

Beilein has not returned a request for comment. Michigan basketball spokesman Tom Wywrot confirmed Beilein's departure later Monday morning.

Last summer, Michigan finalized a new contract with Beilein that was expected to keep him as the program's head coach through the 2022-23 season. The plan was to keep him in Ann Arbor until he decided to retire from coaching.

This all came after Beilein's dicussions with the Pistons in the spring. After going through the process in May, Beilein ultimately opted to remove his name from consideration once he found out he wasn't the team's top choice. He expressed his interest in coaching professional basketball. But, at the time, said he believed he was meant to finish his coaching career at Michigan.

“It became very clear to me where I was meant to finish coaching,” Beilein told the Free Press last June. “If you followed my career, it was ‘you’ve built this up, you’ve got it right and you leave the program in better shape than you found it.’ And then go and do it again somewhere else.

“I wasn’t offered the (Pistons) job. I was a finalist, but I wasn’t offered the job. And I decided rather than to go through it more, I knew where I needed to be.”

Things do change, of course.

A source with knowledge of the situation told the Free Press on Monday that, after Beilein's talks with the Pistons last year, Michigan athletic director Warde Manuel became convinced that Beilein would leave Michigan if/when he received another offer from a pro team.

Manuel, per the source, has had a short list of candidates ready since that time. Michigan athletic department leadership has started the process of examining future candidates, though no names have been made clear at this time.

As was the case during last year's NBA talks: Beilein's decision to entertain pro offers wasn't financially motivated, but rather an ongoing desire for the 66-year-old coach to try his hand at coaching in the NBA before retiring.

Michigan was set to pay Beilein $3.8 million annually through the close of his deal.

The move is sure to test the foundation of Michigan basketball, as Beilein firmly stood as the program's pillar after resurrecting the program from irrelevance after Bill Martin hired him to take over for Tommy Amaker in 2007.

When Beilein took the Michigan job, the program — still feeling the impact from the Ed Martin recruiting scandal — hadn't been to an NCAA tournament in a decade. Beilein got the Wolverines back during his second season. By his fifth season, Beilein had helped Michigan snap a 26-year Big Ten title drought when his 2011-12 team won a share of the league title for the first time since 1986.

The following year, led by consensus national player of the year Trey Burke, Beilein's club came within 40 minutes of a national championship with a title game loss to Louisville in Atlanta. It was Michigan's first Final Four appearance since the Fab Five's second year in 1993, a run that was later vacated due to NCAA sanctions.

Beilein would go on to win the Big Ten outright in 2014. In 2017, Michigan went on a remarkable late-season run that was sparked by a pre-Big Ten Tournament plane accident in Ann Arbor. The Wolverines won the Big Ten Tournament that week before pushing to the Sweet 16. The following year, Michigan was back in the national title game — giving Beilein his second Final Four appearance.

Michigan went to the Sweet 16 or beyond five times during Beilein's tenure, the latest coming this past season.

This spring also saw Beilein lose another round of early entrants into the NBA Draft, as fourth-year junior Charles Matthews, sophomore Jordan Poole and true freshman Ignas Brazdeikis all declared early. In total, Beilein lost a total of 11 early entrants during Beilein's tenure (though Brazdeikis has yet to formally declare that he's staying in this year's draft).

This story will be updated.

Follow Nick Baumgardner on Twitter @nickbaumgardner.