The Arizona Diamondbacks announced they have agreed to terms on a three-year deal with infielder Eduardo Escobar that runs through the 2021 season.

Financial details weren't released by the club, but the contract is worth $21 million, according to MLB.com.

The Diamondbacks acquired Escobar from the Minnesota Twins in late July for three minor leaguers.

"I think the most important thing for me coming here was the people here,'' Escobar said. "There are great people here. Everybody took care of my family and that's the most important thing for me. I signed it because I like it here. I'm happy to be here and ready for next season.''

Escobar, 29, batted .272 with a career-best 23 home runs and 84 RBIs with Minnesota and Arizona in 2018. His 48 doubles were second in MLB.

He started 144 games, including 124 at third base, leaving open the question of what will happen when left-handed third baseman Jake Lamb returns from injury. Escobar can play multiple infield positions, so the Diamondbacks could possibly look at moving players to different positions or trading some of the players -- possibly face-of-the-franchise first baseman Paul Goldschmidt before he becomes a free agent at the end of next season.

"I think what we have on our roster currently, and with Eduardo, is a tremendous amount of flexibility, guys that play multiple positions around the diamond,'' Diamondbacks GM Mike Hazen said. "We're going to hopefully use that to our advantage. Really, that's how he fits in. How it's going to ultimately look at the end of the offseason, that's obviously still to be determined.''

The Associated Press contributed to this report.