Chris Davis drives in 2 runs in the 10th to lead O's to 5-2 win over the Giants

SAN FRANCISCO – The events that transpired in the final two innings of the Orioles’ series opener in San Francisco on Friday night – events that happened well past midnight in Baltimore – displayed first hand the Orioles’ merit as a playoff contender.

Behind a strong pitching performance by right-hander Chris Tillman, the Orioles dominated the defending World Champion Giants, only to seem destined to lose in walk-off fashion in the bottom of the ninth when closer Jim Johnson blew his seventh save of the year, but stranded the winning run 90 feet away.

That’s just the sliver of opportunity that good teams need to win. And when the Giants pitched around Adam Jones in order to pitch to Chris Davis, the major’s top run producer sent the home fans at AT&T Park home shaking their heads.

The Giants’ gamble to walk Jones to get a lefty-lefty matchup with left-handed reliever Javier Lopez against Davis backfired when Davis pulled a game-winning two-out, two-run double past a drawn-in outfield to break a 10th-inning tie in the Orioles’ extra-inning 5-2 win over the Giants in front of an announced 41,434 on a brisk San Francisco night.

“You’ve got to tip your hat to them and give credit where credit is due,” said Davis, who leads the majors with 108 RBIs. “Yet in the end, these kinds of games, this is what the playoffs are going to be like, one-run games, close games, all the way to the end. The fact that we were able to battle back and get the win in the end was huge.”

With the gritty victory -- their sixth in nine extra-inning games this year -- the Orioles (64-51) picked up a game on both AL East leading Boston and second-place Tampa Bay. Baltimore now trails the Red Sox by 4 ½ games and the Rays by 2 ½.

Davis said he wasn’t surprised that the Giants pitched around Jones to face him. Lopez entered the night holding left-handed hitters to a .169 batting average.

“Jonesy’s been swinging the bat well lately,” Davis said. “Obviously with the lefty-lefty matchup on deck, it looks good for them. Just one of those things. Trying to win a ballgame, got guys on base, just looking for a pitch out over the plate that I can drop in the outfield.”

Manny Machado’s one-out double – his majors-leading 42nd of the year -- in the 10th was the Orioles first hit since the third inning. With Machado on second and two outs, Lopez intentionally walked Jones to face Davis, who promptly delivered to give the Orioles a 4-2 lead. Matt Wieters followed with an RBI single that had Giants fans heading for the exits.

“I like our chances with Adam, I like our chances with Matt,” Orioles manager Buck Showalter said. "We’ve got some good people that are hard not to trust. Lopez is one of the better left-on-left guys in baseball. … Chris put a good swing on it. We like all our guys up in those situations.”

The Orioles (64-51) have won the first three games of their eight-game interleague road trip through San Diego, San Francisco and Arizona.

The clocks were about to strike 1 a.m. in Baltimore on Saturday morning when the Orioles dodged what would have been a devastating defeat and quickly turned it into victory.

Tillman completed one of his best performances of the season against the Giants, only to watch it collapse in the ninth.

Instead, Johnson – the majors saves leader with 39 – blew the save, allowing the first three hitters he faced to reach base before recording an out in the ninth.

“Obviously the way that Tilly pitched tonight, he deserves a win,” Johnson said. “Obviously I didn’t do my job, but the team gets a win. … Find the positive in it.”

After Brandon Belt opened the ninth with a single, Johnson issued a full-count walk to Buster Posey. Hunter Pence hit a ball up the middle just past Johnson’s glove and into center field to plate the game-tying run.

“I kind of gator-armed it,” Johnson said of his attempt to snag Pence’s hit. “I should have that. Absolutely I should have had that.”

The 25-year-old Tillman was three outs away from winning his 11th decision in his past 12 starts the first Orioles pitcher to do that since Steve Stone did it in 1980. Tillman also has nine quality starts in his last 12 outings.

He struck out a career-high nine batters – including five straight at one point in the second and third innings – holding San Francisco to one run on four hits over eight innings.

Orioles shortstop J.J. Hardy gave the Orioles a 2-0 lead in the second inning with a solo homer, becoming the third shortstop in franchise history to record three consecutive 20-homer seasons, joining Miguel Tejada (2004-’06) and Cal Ripken, Jr. (1982-’91).

Jones’ two-out single four batters into the game gave the Orioles a quick 1-0 lead in the first inning off Giants starter Ryan Vogelsong. Jones’ hit scored Machado from third base.

Tillman threw 18 of 29 first-pitch strikes and tossed 80 strikes in 112 pitches. Tillman had retired 14 straight until Belt launched a full-count pitch over the right-center field fence for a solo homer with two outs in the sixth, cutting the Orioles’ lead to one.

Tillman recovered, retired seven of eight to finish his night. He stranded the tying run on first in the eighth after allowed a lead-off single to Gregor Blanco in the eighth.

“We’ve got a good team,” Tillman said. “These guys never give in. They haven’t been giving in all year. They are fun to watch. As a pitcher, you [want to] get them back in the dugout. I knew the game wasn’t over. I thought we had a good chance at winning it.”