The St. Louis Cardinals have acquired All-Star first baseman Paul Goldschmidt from the Arizona Diamondbacks in exchange for right-handed pitcher Luke Weaver, catcher Carson Kelly and infielder Andy Young, the teams announced Wednesday.

The Diamondbacks also receive a 2019 Competitive Balance Round B draft pick from the Cardinals.

Goldschmidt, 31, an All-Star each of the past six seasons, had a .290 batting average with 33 home runs, 83 RBIs, 35 doubles and 90 walks last season. His .922 OPS ranked third in the National League and his .934 OPS since 2012 is second highest in the NL behind Cincinnati's Joey Votto during that span.

"We've been busy this offseason working to upgrade our lineup, and today we are excited to announce the acquisition of one of the game's premier players," Cardinals president John Mozeliak said in a statement.

St. Louis went 88-74 and believed it needed a boost in the middle of a lineup that includes Matt Carpenter, Marcell Ozuna and Yadier Molina to compete with the likes of the Milwaukee Brewers and the Chicago Cubs in the NL Central. The Cardinals' postseason drought is their longest since 1997-99.

Goldschmidt, who has finished second or third in NL MVP voting three times, is heading into his final season of club control and receives a $1 million assignment bonus for the trade. He stands to earn $14.5 million in 2019 before reaching free agency next winter.

Good As Goldy Since his first full season with the Arizona Diamondbacks in 2012, Paul Goldschmidt has been one of the best players in baseball. MLB Rank OBP .400 3rd RBI 684 3rd HR 201 6th >>2012: Goldschmidt's first full MLB season

Considered the face of the franchise, Goldschmidt was a consistent performer both at the plate and in the field during his eight seasons with the Diamondbacks, winning four Silver Slugger Awards and three Gold Gloves.

"This was an extremely difficult decision given how much Paul has meant to our team both on and off the field," Diamondbacks president Derrick Hall said. "He represents everything it means to be a D-back, and we are very thankful to him for all that he has done for our franchise and our fans."

It shouldn't take long for Goldschmidt to endear himself to Cardinals fans. Over his career, he has a 1.170 OPS in 43 games against the rival Cubs.

Goldschmidt has had four seasons with at least 33 home runs and has 209 overall. He also has a .297 career batting average with 710 RBIs, and he ranks second only to Luis Gonzalez in franchise history in all three categories.

Arizona went 82-80 in the NL West and finished behind the Los Angeles Dodgers and Colorado, who both made the playoffs.

The rebuilding Diamondbacks parted ways with a homegrown player who grew to be the face of the franchise but is nearing the end of an extremely team-friendly contract. The quiet slugger, an eighth-round draft pick out of Texas State in 2009, quickly moved through the Arizona minor league system and advanced to the big league club in 2011.

"Certainly this is a bittersweet decision on our part,'' Diamondbacks general manager Mike Hazen said on a conference call. "I don't think I could overestimate the impact that Paul had on our team.''

Hazen said the key to the deal was what the Cardinals offered in return. If there was no trade, the Diamondbacks faced the prospect of Goldschmidt leaving as a free agent after next season.

"There are decisions you want to do, and there are decisions you know you have to do,'' Hazen said.

He said he understood fans' disappointment.

"Paul is possibly the best player in the National League,'' Hazen said. "We understand that. We've understood that for a long time.''

Weaver, 25, who was the 27th overall pick in the 2014 draft, went 7-11 with a 4.95 ERA and 121 strikeouts in 25 starts for the Cardinals last season. Overall, he has a 4.79 ERA in 233 career innings pitched and was the Cardinals' minor league pitcher of the year in 2016.

Kelly, who has a .154 batting average in limited action over parts of three seasons, is highly regarded for his defensive ability and was ranked as one of the Cardinals' top prospects.

Young, who hit a combined .289 in Double-A and high-A, finished fifth in the 2018 Arizona Fall League with a .936 OPS.

The draft choice that Arizona got will come after the second round, likely a pick somewhere in the high 70s or low 80s.

ESPN Stats & Information and The Associated Press contributed to this report.