The teams announced the deal Wednesday. The Tigers also sent cash considerations to the Cubs, and received right-handed pitching prospects Alex Lange and Paul Richan in the trade.
The 27-year-old slugger is expected to provide an offensive boost to the Cubs as they enter Wednesday's game against the St. Louis Cardinals. Chicago, holding a wild-cart spot, sits one game behind the first-place Cardinals in the National League Central.
Castellanos has a .273 batting average with 11 home runs and 37 RBIs in Detroit this season. His best year came in 2017, when he blasted 26 homers and recorded 101 RBIs with a .272 average.
Castellanos has 37 doubles in the 2019 campaign, tying Boston Red Sox slugger Rafael Devers for the most in the majors. His 119 doubles over the last three seasons trail only Red Sox superstar Mookie Betts.
Richan, 22, is 10-5 with a 3.97 ERA in 17 starts at the Class A level. Lange, 23, had a 1-9 record with a 7.36 ERA in 11 starts before moving up to Double-A. He had a 3.92 ERA and 28 strikeouts in 39 innings after his promotion.