The Pistons took a roll of the dice on Bagley when they acquired him at the trade deadline to see how the former No. 2 overall pick could fit in with the rest of their roster.
Bagley was solid in his two-month audition in Detroit, playing more minutes (27.2 per game) than he ever had in Sacramento and averaging more points (14.6) and shooting better from the field (55%).
The Pistons were impressed by what they saw in their short stint with Bagley, 23, after the deadline and had expressed interest in re-signing him to a long-term deal.
In 3½ seasons in Sacramento, Bagley averaged 13.5 points and 7.4 rebounds on 49.4% shooting, catching the ire of Kings fans for the team's decision to draft him ahead of Luka Doncic.
Yahoo Sports first reported Bagley's deal.
ESPN's Jamal Collier contributed to this report.