Despite a recent surge, it appears the Brewers are trade-deadline sellers.

Milwaukee sold its first piece Thursday afternoon, dealing veteran third baseman Aramis Ramirez to Pittsburgh for minor-league pitcher Yhonathan Barrios. The Brewers announced they will also send cash considerations to the Pirates to help cover some of Ramirez's salary, which was $14 million this year.

FOX Sports' Ken Rosenthal reports the Pirates will pay $3 million of the roughly $6 million left on Ramirez's contract.

More from FoxSports

It's a full-circle move for Ramirez, who started his professional career with the Pirates in 1998, before being traded to the Chicago Cubs exactly 12 years ago to the day in 2003. The 37-year-old had already announced that 2015 would be his final season, but the 54-40 Pirates hope his leadership and bat will help them in the playoff race.

The Pirates needed help at the hot corner after injuries to third baseman Josh Harrison and shortstop Jordy Mercer forced them to shuffle players around at the position.

Barrios is a 23-year-old right-handed reliever who, in 33 games between Double-A and Triple-A this season, was 1-3 with a 2.68 ERA and a 1.31 WHIP. He had 21 strikeouts and 17 walks in 40 1/3 innings.

Ramirez, a three-time All-Star, is batting .247 with 11 home runs and 42 RBI this season. His OPS of .725 is the lowest he's had since 2010. Ramirez joined the Brewers as a free agent in 2012, batting .300 with 27 homers and 105 RBI that season.

In six seasons in Pittsburgh, Ramirez hit .263 with 76 home runs.

The Brewers have been one of baseball's hottest teams over the last month. Since June 23, they are 17-7 and had won four games in a row before losing to the Cleveland Indians on Wednesday. At 42-53, though, they are still 9.5 games back for the second NL Wild Card spot.

Follow James Carlton on Twitter