NEW YORK — The Orioles managed almost no offense Friday night. Their starting pitcher tied a career high with six walks. And yet they were close to winning.
But this is Yankee Stadium, where bad things often happen to the Orioles.
True to form Friday night, Carlos Beltran hit a two-out, three-run homer to left field off Orioles closer Zach Britton to give the New York Yankees a 5-3, walk-off win.
"You're one good pitch away," Britton said. "Keeping the ball down, I can get out of that inning."
It was Beltran's seventh homer of the season and the Yankees' first walk-off shot since last August.
Britton, who had allowed just one run in his previous 21 games and one hit in his previous five outings, gave up two singles and a walk before serving up the 96-mph fastball to Beltran on a 3-1 count.
Britton (3-1) hadn't lost yet this season and had blown just one other save in his first 10 chances. It was just his second homer allowed in 2014.
"It's a fine margin of error," Orioles manager Buck Showalter said. "Tonight, he wasn't able to make the last pitch that [he has in] a lot of three-up, three-down [innings]. It's not an easy job. And he's been doing it at a very high level. And hopefully will again."
The Orioles (37-35) have dropped two games behind the Yankees (39-33) for second place in the American League East.
The teams are 2-2 against each other at Yankee Stadium, where the Orioles have had a losing record in 15 of their past 16 seasons.
It was an all-around ugly game, but one the Orioles nearly won.
Right-hander Ubaldo Jimenez finished one out shy of picking up his second consecutive quality start (three runs or fewer in six innings or more) — by definition, anyway.
But it was far from a quality outing from the Orioles' highest-paid pitcher.
Jimenez pitched into the sixth and allowed just one run, in the first inning. But he nearly handed over the game multiple times because of an inability to throw strikes.
He issued a season-high six walks in 5 2/3 innings, and on three different occasions loaded the bases without, somehow, yielding a run.
"I could look at the finished product and say one thing, but the six walks, I thought — he and we were very fortunate to survive those tonight," Showalter said. "I think, more times than not, the baseball gods will get you on that one."
Jimenez, whom the Orioles signed this offseason to a franchise-record four-year, $50 million free-agent deal for a pitcher, now has walked 16 batters in his past 14 innings, spanning three starts, and has walked 51 batters in 81 2/3 innings this season.
On Friday, Jimenez threw only 53 of his 104 pitches for strikes.
For the first half of the game, though, the storyline tilted toward the Yankees' 39-year-old right-hander, Hiroki Kuroda, who had a 1.67 ERA in five previous career starts against the Orioles in the Bronx. He continued that momentum Friday, holding the Orioles hitless through five innings — the third opposing hurler to do that to the Orioles this season.
In those previous two games — Kansas City's Danny Duffy threw 6 2/3 innings hitless May 17 and Boston's Brandon Workman had 5 2/3 hitless innings June 10 — the Orioles eventually broke up the no-hit bid but failed to score, losing, 1-0, each time.
They ended that trend Friday, getting four hits and two runs in five plate appearances in the sixth against Kuroda after going hitlesss in their first 17 trips to the plate.
Nick Hundley led off the sixth with a double — his first extra-base hit as an Oriole in his 36th at-bat — and scored when the hot-hitting Steve Pearce doubled to left.
Pearce broke the tie on Adam Jones' single to right, Jones' 44th RBI of the season. Ultimately, Kuroda made it through six innings, allowing just the two runs on four hits — all in the sixth — and a walk while striking out six.
"Kuroda is a good pitcher," Showalter said. "He's been tough on us, doesn't make very many mistakes."
Pearce gave the Orioles an insurance run in the ninth with an RBI single that scored Jonathan Schoop. He is 6-for-12 with five RBIs in his past three games.
The Yankees scored first in the first inning. With two outs, Jacoby Ellsbury hit an infield single and stole second easily when Hundley threw wildly into center.
Mount St. Joseph graduate Mark Teixeira followed with an RBI double to right for the 1-0 lead.
Jimenez induced a pop-up to end the first and pitched out of a bases-loaded jam in the second when Jones caught a shallow fly in center and then easily threw out Beltran at the plate for a double play.
Jimenez also escaped with the bases loaded in the fifth without allowing any runs after issuing three consecutive five-pitch walks before Teixeira swung at the first offering and grounded out to first.
"When everything is good, it's not hard," Jimenez said. "The first four innings, I felt good, I was attacking the strike zone, getting ahead.
"It seemed like tonight, when I got a runner on first base, that's when I started to go too quick."
T.J. McFarland bailed Jimenez out of his third bases-loaded mess in the sixth, getting a ground ball up the middle by Brett Gardner that second baseman Ryan Flaherty gloved and then flipped to J.J. Hardy for the forceout.
McFarland, who had allowed seven of 11 inherited runners to score, stranded the three in the sixth and pitched superbly after that.
He threw two perfect innings before Darren O'Day entered with two outs in the eighth.
The Yankees strung together two consecutive hits against O'Day, but Yangervis Solarte hit a high fly to left to end the threat.
Then Britton entered in the ninth with a two-run lead and couldn't hold it. He gave up a single, a walk and an RBI base hit to Brian McCann before Beltran ended it with one swing.
"It's frustrating, because these are games we want to win right now," Britton said. "But, yeah, you've got to turn the page. It is the only thing you can do."