CHICAGO (AP)The Chicago Cubs and Dansby Swanson agreed to a $177 million, seven-year contract on Saturday, adding the All-Star shortstop to their rebuilding project.

The deal includes a full no-trade clause, according to two people familiar with the negotiations who spoke to the AP on condition of anonymity because the contract was pending a physical.

Chicago went 74-88 this year and finished third in the NL Central. It was its second straight losing season, but it went 40-31 in its last 71 games.

The addition of Swanson is the biggest of three major moves by the Cubs since the end of the season. The team finalized a $17.5 million, one-year contract with 2019 NL MVP Cody Bellinger on Wednesday, and right-hander Jameson Taillon agreed to a four-year contract that is worth roughly $68 million.

With Swanson in the fold, Nico Hoerner likely moves from shortstop to second base. Coupled with Bellinger in center, Chicago should be one of the majors’ best teams when it comes to up-the-middle defense.

The Cubs also bolstered their bullpen when they agreed to a $2.8 million, one-year contract with Brad Boxberger this week.

Swanson was part of a stellar group of free agent shortstops that also included Trea Turner, Carlos Correa and Xander Bogaerts. He was the last one of the four to decide on a team.

Swanson was selected by Arizona with the No. 1 overall pick in the 2015 amateur draft, but he was traded to Atlanta in a multiplayer deal that December.

With the Braves, Swanson became part of a young core that led the franchise back to the top of the NL East. He batted .248 with 27 homers and 88 RBIs in 2021, helping Atlanta to its first World Series championship since 1995.

The 28-year-old Swanson is coming off perhaps his best big league season, hitting .277 with 25 homers and a career-best 96 RBIs in 162 games. The shortstop made the NL All-Star team for the first time and also won his first Gold Glove.

While Atlanta managed to sign a couple of its young stars to team-friendly, long-term deals, it was unable to do the same with Swanson. After the team was eliminated by Philadelphia in the NL Division Series, the Braves gave Swanson a $19.65 million qualifying offer. But the Kennesaw, Georgia, native declined the proposal.

Swanson, who played college ball at Vanderbilt, made his big league debut with Atlanta in 2016. He is a .255 hitter with 102 homers and 411 RBIs in 827 career games.

Swanson and Chicago Red Stars forward Mallory Pugh got married last weekend in Georgia.

NBC Sports Chicago and ESPN were first to report that Swanson was nearing a deal with the Cubs, and Bally Sports was the first to report details of the contract.

Follow Jay Cohen at https://twitter.com/jcohenap

AP MLB: https://apnews.com/hub/mlb and https://twitter.com/AP-Sports