BALTIMORE -- The Orioles were close on several things on a wild non-waiver Trade Deadline on Thursday afternoon and ended up adding what they ultimately wanted: a significant upgrade in the bullpen.

The O's acquired left-handed reliever Andrew Miller from the Boston Red Sox, a deal that adds a solid piece to the back end of the bullpen. But it also cost them one of their top pitching prospects in left-hander Eduardo Rodriguez, something that executive vice president of baseball operations Dan Duquette tried to avoid.

"This was required ... it wasn't our first choice to trade him," Duquette said of the 21-year-old Rodriguez, who was ranked as the O's third-best prospect by MLB.com. "The kid has talent and he has youth. But our team is in the race. We want to continue what we started, and we needed to add to our club to be competitive with the other clubs, not just in our division, but the other clubs in the American League in the playoff situation."

"I hope we play well enough that we see all of them again," manager Buck Showalter said of the trio's departure from the AL East.

Miller, expected to land in Baltimore late Thursday night, should help. He fills a need for the Orioles, giving them a left-handed reliever who's effective against lefties and righties. A free agent at season's end, Miller has a 2.34 ERA and has struck out 69 in 42 1/3 innings this season. The 29-year-old has held righties to a .180./.279/.258 line and lefties to a .150/.203/.217 line.

"He's just another good piece. He goes with some other good pieces down there. He gives us more depth down there, keep passing the load around," Showalter said. "I think he's a little more than just a left-handed arm. You look at left-handed relievers, the ideal ones are the guys that you've got left-right-left and you can leave them in there for the right."

The deal, which was announced with less than hour before the 4 p.m. ET deadline, is a bit of a departure for the O's in terms of dealing one of their young arms, but it wasn't a complete shock. Rodriguez has had a down year, along with an injury, making it easier for the organization to give up the young lefty. Duquette wasn't willing to sacrifice too much of the future to try to bring back a frontline starter.

"We were involved in several other discussions to help the team in other areas," Duquette said. "And we've got a good idea what the value of our young prospects were and what the value they can bring in trade, but this was the most impactful trade I thought we could make, given what we had to trade and what we were wiling to trade.

"Given the way our team has been playing in terms of the starting pitching coming around, this fills a void and gives Buck a weapon late in the game to lock down the lead. And when you get into close games, a lot of times it's decided by the bullpen late in the game. So, if our club can advance into the playoffs and postseason, a lot of those games are decided on the back end, the seventh inning on."

Showalter acknowledged the difficulty now is creating space for Miller. The Orioles already have three lefty relievers in T.J. McFarland, Brian Matusz and closer Zach Britton. McFarland has an option and could be the odd man out, with righties Ryan Webb and Brad Brach also having Minor League options.

Miller is expected to be in uniform for the Orioles on Friday while Rodriguez will head to the Red Sox's Double-A affiliate.

Rodriguez missed more than a month with a knee sprain sustained while lifting weights earlier this season, and has pitched to a 4.79 ERA at Double-A Bowie. There were some internal questions about his work ethic in coming back from the injury, but Rodriguez is still a young, inexpensive left-handed pitcher with a lot of upside and has been one of the youngest players invited to big league camp the past two seasons.

The Orioles are gambling Miller for the next two months will be worth it.

"We know that the Red Sox like him and other teams will like him," Showalter said, "but we think he can impact our ability to make the playoffs and we are willing to take that risk."