Aramis Ramirez was signed by the Pittsburgh Pirates as an amateur free agent back in 1994. He'll now rejoin the organization that he called home from 1994-2003.

The Milwaukee Brewers traded Ramirez to the Pirates on Thursday (first reported by Craig Calcaterra of NBC Sports' HardballTalk) in exchange for minor league right-hander Yhonathan Barrios and cash considerations (per Steve Adams of MLBTradeRumors.com). The Pirates will pay $3 million of Ramirez's remaining $5.74 million, according to FOX Sports' Ken Rosenthal.

Pittsburgh has been in need of infield help after third baseman Josh Harrison was lost due to torn ligaments in his thumb and shortstop Jordy Mercer went down with an MCL sprain last week. Ramirez has been the subject of trade rumors because he'll be a free agent after the season and the Brewers have long been out of the playoff picture.

The 37-year-old spent six MLB seasons with the Pirates (1998-2003) and batted .263/.312/.435 with 222 runs scored, 76 home runs and 316 RBIs in 559 games over that span. He got off to a slow start in 2015 after a solid 2014 campaign, but he has improve his offense as of late and is now hitting .247/.295/.430 with 25 runs scored, 11 home runs and 42 RBIs in 81 games.

It's unknown how Ramirez will fit in once Harrison returns from the disabled list, but it's possible he remains at third base while Harrison takes some reps in the outfield. He could also split some time with Pedro Alvarez at first base, especially since Alvarez is one of the worst defenders (if not the worst) in the MLB.

As for the Brewers, they added a piece to their farm system in Barrios. The 23-year-old reliever owns a 2.68 ERA and 1.31 WHIP in 33 games (40 1/3 innings) this season between Double-A Altoona and Triple-A Indianapolis. As the club endures a possible rebuild, these are the types of moves they're looking to make.

Milwaukee also has a number of other players on the trade block, including Carlos Gomez, Jean Segura, Matt Garza, Kyle Lohse, Francisco Rodriguez, Adam Lind and more.

The Brewers will most certainly be active within the next eight days before the trade deadline and it's possible the Pirates will still be searching the market for some starting pitching.