Red Sox general manager Theo Epstein and the Chicago Cubs have agreed to a five-year deal for him to join the team.

Initial reports have placed the compensation between $15 million and $20 million, and the deal also includes the Cubs picking up the conclusion bonus in Epstein’s Red Sox deal.

Epstein was the Red Sox general manager for nine seasons and had one year remaining on his current deal in Boston. He had been to Chicago on two separate occasions to meet with Cubs officials, according to multiple reports.

The Cubs fired general manager Jim Hendry on Aug. 19 and finished 71-91 overall. The Red Sox missed the playoffs following a record collapse, going 7-20 in September to finish at 90-72.

Epstein will be taking over a franchise that hasn’t won the World Series since 1908. Boston hadn’t won a championship since 1918 until doing it in 2004, Epstein’s second year as the team’s general manager. Boston then did it again in 2007.