Updated

MILWAUKEE (AP) Getting traded to the Pittsburgh Pirates in the middle of a pennant race hasn't changed third baseman Aramis Ramirez's mind about retirement.

Ramirez reiterated on Wednesday that he's ending his 18-year career after this season.

''No, no, no. I'm going home. That's it. It couldn't be any better. I'm going to be in the pennant race my last year,'' Ramirez said at Miller Park before the Pirates played his previous team, the Milwaukee Brewers.

Milwaukee sent Ramirez to the Pirates on July 23 for minor league pitcher Yhonathan Barrios. The Pirates' three-game series in Milwaukee this week marked Ramirez's first visit back since the deal.

The 37-year-old Ramirez was greeted warmly at the plate in his first trip to the plate in the series opener on Tuesday. He received a standing ovation after a solo shot in the ninth inning of Pittsburgh's 7-4 loss.

Ramirez spent 3 1/2 seasons with the Brewers after signing as a free agent before the 2012 season. Milwaukee never made the playoffs during that tenure, though Ramirez said he would do it all over again if he could.

''When I hit that homer, they treated me like I still played for the Brewers,'' Ramirez said. ''Great fans here.''

He is ending his career with the team with which he broke into the big leagues in 1998. The return has energized Ramirez at the plate, hitting .301 with three homers and 19 RBIs since Aug. 5.

''Something to play for, put it that way,'' Ramirez said, ''you're contributing to a team that's fighting for a playoff spot.''