DETROIT -- Dwane Casey is on his way to Detroit, sources tell The Associated Press.

The AP reports that Casey, who was fired last month after the Toronto Raptors were swept by Cleveland in the second round of the post-season, has reached an agreement on a five-year deal to become the Pistons' next head coach.

Casey's firing came after the Raptors recorded a franchise-best 59 wins in the regular season, earning the No. 1 seed in the Eastern Conference for the first time in history.

The Raptors' head coach search, meanwhile, has reportedly be narrowed to two names: Raptors' assistant Nick Nurse, and San Antonio assistant Ettore Messina.

The Raptors dispatched Washington in six games in the first round of the post-season, but couldn't win a game against nemesis LeBron James and his Cavaliers in the conference semifinals.

Casey is the front-runner for the NBA's coach of the year award to be presented later this month. The 61-year-old was the most successful coach in Raptors history, with a 320-238 record, three 50-win seasons and four Atlantic Division titles.

Casey told ESPN last week that a big draw in Detroit was the team's senior adviser Ed Stefanski, who was the Raptors' executive vice-president of basketball operations from 2011-13.

Detroit is rebuilding its franchise, hiring both Stefanski and now Casey to replace former team president and coach Stan Van Gundy.