The Detroit Pistons and Stan Van Gundy have reached agreement on a five-year, $35 million for him to become their head coach and president of basketball operations.

The deal was formally announced on Wednesday.

Van Gundy has been out of the NBA over the past two seasons after being fired by the Orlando Magic.

The Golden State Warriors were also very interested in Van Gundy, making him their top target, but they were unwilling to cede authority away from Bob Myers.

Sources say the opportunity for Van Gundy to have a Pat Riley-level say on basketball matters swayed him to choose the Pistons over the Warriors.

Adrian Wojnarowski of Yahoo! Sports reported that Van Gundy may hire Otis Smith to serve as day-to-day general manager.