BALTIMORE -- Two jams was one too many.

Orioles closer George Sherrill had to come in with the bases loaded and two outs in the eighth inning Friday night, and after escaping, he had to do it all over again. Sherrill got two quick outs in the ninth, but then he gave up a single and a two-run home run, which led to a 5-4 loss to the Rangers at Camden Yards.

Third baseman Michael Young did the honors for Texas, pushing the road team ahead for the first time since the third inning with an opposite-field homer over the right-field fence. That home run all but erased a commanding performance from Koji Uehara, who struck out six Rangers and didn't walk any.

"It would've been a good one to win, and it was a tough one to lose," said manager Dave Trembley. "We needed one more out. We needed one more pitch. We had chances to score more runs and didn't. Koji pitched very well, made some adjustments from the first time he pitched against those guys. He located very well, changed speeds. They scored runs at the end of the game. We were one out away from closing it out, and didn't do it."

And that really was the story. Sherrill came on with a one-run lead and the bags packed in the eighth inning, and he was able to exploit a left-on-left matchup against Chris Davis. Sherrill threw several breaking balls before getting Davis to swing through one, and then he came back for the ninth with the same goal in mind.

Sherrill made quick work of Jarrod Saltalamacchia and Elvis Andrus before getting into a tough confrontation with leadoff man Ian Kinsler. Kinsler, who hit for the cycle last week against Baltimore, saw eight fastballs before singling, and Young watched two more heaters before drilling a pitch into the seats. Trembley, who rearranged his bullpen a day earlier, got the exact matchup he wanted. He used two relievers -- Jamie Walker and Chris Ray -- to back up Uehara in the seventh. Then he went to setup man Jim Johnson with a two-run lead in the eighth, and when that didn't work, he prudently went to his relief ace.

"He's been rested -- I thought it was the right thing to do," said Trembley. "And I'd do it again, given the circumstances that he hadn't pitched a whole lot. You're not going to do that if the guy's pitched a couple days in a row."

Uehara, who had been charged with seven earned runs in his previous outing against the Rangers, stayed out of harm's way for most of the night. The right-hander didn't allow a baserunner in the first two innings, and though he briefly let Texas take control in the third, he pitched even better late in the game.

"I think it was a good outing," Uehara said via interpreter Jiwon Bang. "I think I was able to get ahead in the count."

"He read their bats every well, was slowing them down and speeding them out through a combination of his fastball and his offspeed stuff," added Trembley. "He had a lot of guys out in front and then he was tying people up inside with his fastball. ... It gets on guys when he pitches in, and that's what he did again tonight."

The Orioles assumed command in the fourth inning, thanks to help from Vicente Padilla. Aubrey Huff doubled in two runs and moved to third on the resulting throw home, and then Padilla balked him home to give the Orioles an insurance run. Baltimore scored again in the fifth on a solo home run by Brian Roberts.

The home team actually had a chance to score more runs in that inning, thanks to two singles and a walk from the heart of the order. Ty Wigginton came up against Padilla with the bases loaded, but he flew out to center field on the first pitch he saw. Moments later, Luke Scott also flew out on the first pitch.

"With a hit, we probably would have knocked him out and opened the game up, and it didn't happen," said Trembley. "We wish we would have capitalized on that a little better, but you don't know if he made a good pitch or we're overanxious. I'd like to think that he just made a better pitch to get our guys out."

Uehara allowed just one baserunner from the fourth inning through the sixth, but Hank Blalock reached him for a solo homer in the seventh. Uehara got two more outs and then left with a two-run lead. Trembley used his southpaw specialist for one batter -- a single -- and then went to Ray to get the final out of the seventh.

Johnson gave up four hits in the eighth, but two of them never left the infield. And though the game didn't turn out the way he may have liked, Trembley still thought it broke down the way he wanted. In his mind, Baltimore's inability to retire Saltalamacchia -- who had three hits for Texas -- was the difference in the game.

"It looked like we had the right matchup there -- Koji got us late into the game," Trembley said. "Their lineup is such that what I'm trying to avoid there is, 'Let's get the guys in the bottom of the lineup out. Lets not let those other guys at the front come up.' ...We didn't get the No. 8 guy out, and I've been saying that for three days."

"For us, we made an out. Our eighth-place guy made an out. We didn't roll the lineup over. So sometimes it works for you and you get by with it, sometimes it doesn't -- and you pay the price for it."