Michigan coach John Beilein announces his decision to stay in Ann Arbor after previously expressing interest in the vacant Pistons' head coaching job. (1:41)

Michigan men's basketball coach John Beilein says he's staying with the Wolverines after interviewing last week for the Detroit Pistons' coaching vacancy.

Beilein announced his intentions Wednesday on Twitter, writing that he plans to coach Michigan during the 2018-19 season and "in the years to come!"

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 "#GoBlue — John Beilein (@JohnBeilein) June 6, 2018

League sources told ESPN's Adrian Wojnarowski that Beilein interviewed with the Pistons on Thursday and had emerged as a top candidate for the position but pulled out after discussions about the job with both management and ownership.

Former Toronto Raptors coach Dwane Casey and San Antonio Spurs assistant Ime Udoka are also being considered for the Pistons vacancy, league sources told ESPN. Casey met with Detroit owner Tom Gores on Tuesday, his second interview with the team, sources said.

Udoka was scheduled to meet with Gores on Wednesday in a second meeting with the organization, sources said.

Beilein is under contract with Michigan through the 2020-21 season, a deal that pays him $3.37 million annually, and a school spokesman said a contract extension is imminent. The extension was in the works before Beilein interviewed with the Pistons and was not a result of his decision to meet with the NBA team.

"We are thrilled that John Beilein will be our coach now and into the future. We made it a priority to sit down shortly after our tremendous run in the Final Four to discuss and solidify his future at Michigan," athletic director Warde Manuel said in a statement. "Michigan has become home for John and Kathleen the past 11 years and we are excited they plan to stay for years to come."

Michigan won a team-record 33 games in 2017-18 and reached the national championship game before falling to Villanova. The Wolverines also made the title game in 2013 and have reached the Sweet 16 or beyond four times under Beilein.

The 65-year-old is Michigan's all-time coaching wins leader with a 248-143 record in 11 seasons at the school. He has guided the Wolverines to two Big Ten titles, eight NCAA tournament appearances and two national runner-up finishes.