ANN ARBOR, Mich. — John Beilein is returning to the University of Michigan. He will do so with a revised contract.

A source tells The Athletic that Beilein and the school have nearly finalized a two-year extension on his previous three-year contract. Now a five-year contract through 2022-23, the restructured deal will come with a rolling extension, which will keep the agreement at five years after each season. It is believed Beilein will receive a raise from $3.37 million annually to just under $4 million per year.

Beilein was a candidate for the Detroit Pistons’ head-coaching vacancy, having twice met with the organization, including an interview in Detroit as recently as last Thursday. He did not receive an offer from the Pistons, who are still in the process of making a hire.

In a tweet on Wednesday, Beilein wrote: “I love the University of Michigan and I am excited about coaching our Men’s Basketball Team next season and in the years to come ! Let’s go hang some more banners at “THE GREATEST UNIVERSITY IN THE WORLD””

Beilein’s revised contract at Michigan was in the works prior to his discussions with the Pistons. He is the all-time winningest coach in U-M men’s basketball history and is coming off a 33-8 campaign that included a second trip to the national championship game.

The Wolverines are projected as a preseason top-25 team in 2018-19, Beilein’s 12th season at the helm.

(Top photo: Robert Hanashiro/USA TODAY Sports)