Chicago announced the move on Friday. The Cubs also traded left-handed pitcher Drew Smyly and a player to be named to the Texas Rangers in exchange for a player to be named.
Hamels would have received a $6 million buyout from the Texas Rangers if the Cubs declined the option. Chicago acquired Hamels in a July 27 trade with the Rangers. The 34-year-old posted a 2.36 ERA and a 4-3 record in 12 games with the Cubs. He had a 4.72 ERA and a 5-9 record in 20 games for the Rangers this season before being traded.
For his career, the four-time All-Star owns a 3.40 ERA and a 156-114 record on the hill. Hamels played the first 10 seasons of his career with the Philadelphia Phillies before joining the Rangers during the 2015 season.
He was the 2008 World Series MVP while with the Phillies.
Hamels joins a stable of starting arms for the Cubs which includes Jon Lester, Kyle Hendricks, Jose Quintana and Yu Darvish. Chicago posted the third-best ERA in baseball this season at 3.65 and led baseball in innings pitched.