ST. LOUIS -- As part of their efforts to build for the future, the D-backs on Sunday traded second baseman Felipe Lopez to the Brewers in exchange for a pair of Minor Leaguers.

Lopez, who will be a free agent following the season, hit .301 for Arizona and was one of the team's most consistent hitters.

"Obviously where we are in the standings, I think you have to consider trades like this," D-backs general manager Josh Byrnes said. "Felipe played really well for us and fit in well, especially with the younger players, but the reality is he's a free agent at the end of the year and he brought back two guys that we think have long-term value to us."

In return for Lopez, the D-backs received outfielder Cole Gillespie and right-handed pitcher Roque Mercedes.

Gillespie, who was a member of the 2006 Oregon State University College World Series championship team, was hitting .242 with 12 doubles, seven homers and 27 RBIs for Triple-A Nashville.

The 25-year-old had the start of his season delayed by a sprained elbow.

"Gillespie is a guy we actually liked a little bit in the Draft," Byrnes said. "[He] has gone out and performed well. He had a slow start this year, had an elbow injury coming out of Spring Training, but he's in Triple-A and we think he has a chance to be a Major League player for us."

Gillespie will be assigned to Triple-A Reno.

Mercedes was 1-1 with a 1.08 ERA and six saves for Brevard County in the Class A Florida State League. The right-hander walked eight and struck out 26 and seems to have taken nicely to a relief role after beginning his pro career as a starter.

The 22-year-old has a low-90s fastball and what Byrnes said was an above-average slider.

"We like his potential as a reliever down the road," Byrnes said.

The D-backs are leaning toward starting Mercedes out at Double-A Mobile, but they could also assign him to Class A Visalia of the California League.

Losing Lopez's bat will no doubt hurt the D-backs' lineup, but having entered play Sunday in fourth place in the National League West -- 18 games behind the first-place Dodgers and 10 1/2 in back in the Wild Card race -- the organization has set its sights on 2010.

"A trade like this ... our thought process is building up our talent and our roster to compete in 2010 and beyond," Byrnes said. "In the offsesason, if there are free agents out there, we'll take a look at them if we have a hole to fill."

One of those holes figures to be at second base. For the meantime, the team will recall infielder Ryan Roberts from Reno to take Lopez's place on the roster. Roberts will share time at the position with Augie Ojeda.

This is the second trade the D-backs have made in the past few weeks. Previously, the club sent reliever Tony Pena to the White Sox for first-base prospect Brandon Allen.

The team has two veteran free agent-to-be pitchers in Doug Davis and Jon Garland who may draw some interest from contenders, though it appears the D-backs may elect to try to sign Davis to an extension.

"I don't know," Byrnes said when asked if other trades were in the offing. "We've had discussions. I think we have an idea of what it would require for us to make additional trades, and if we don't feel like we're getting enough value, then we're not going to make the trade. We obviously want to continue to play well the rest of this year, and with the three prospects we've added, create a little bit of momentum and additional talent for next year and beyond."

For Lopez, who was told of the deal following Arizona's 2-1 loss to St. Louis, the news was bittersweet. On the one hand, he is going to a team in the thick of the pennant race, while on the other, he is leaving a group of teammates he enjoyed.

"It's just the business side of baseball," Lopez said. "I'm leaving here on a good note with this organization. One of the reasons I signed here was because I believe in this organization; I still do. This team is only a couple of things away from being really good. Everybody treated me well here -- coaches, players -- so I had a great experience here."