OAKLAND — Baltimore Orioles pitcher Kevin Gausman was a rookie the last time Oakland Athletics starter Trevor Cahill struck out double-digit hitters in a Major League game. On a night where Cahill struck out a career-high 12 in six innings, the hard-throwing lefty out of Louisiana State upstaged him, shutting out the A’s for nine.

Neither of those two men, though, figured in the decision on Saturday night.

Instead, after going 8 1/3 innings without a hit, and after not seeing a runner reach second all game, Oakland got a walk-off two-run home run by Khris Davis in the bottom of the 12th. The drive clinched the three-game series against Baltimore with a 2-0 win.

“It was all about the pitching today,” said manager Bob Melvin. “Trevor was terrific. 12 punchouts in six innings, the further you get in a game like that, the more the pitchers really have to grind. No one wants to be that guy who gives up the run. It was more about the pitching today, but certainly, Khris had a say in that.”

For Davis, it was his third career walk-off home run, ending a three-hour, 32-minute affair by driving in himself and Jed Lowrie on a 3-1 fastball from reliever Pedro Araujo after seven pitchers for both teams combined to strike out 31.

It was the first time in franchise history that the Athletics (17-16) ended a scoreless extra-inning game with a walk-off home run.

The walk-off overshadowed, to some extent, the work of Cahill, who felt his change up early in warm-ups and went to it often, throwing it 28 times on a 98-pitch night and getting 16 swings and misses.

“We just kind of kept going to it,” Cahill said. “I was able to tail some good front-door sinkers to the lefties, and Bruce [Maxwell] called a good game. I haven’t thrown to him that much, but he did a really good job knowing the scouting report and knowing what was working.”

Maxwell, catching for the first time since April 28 and catching Cahill for the first time this season, knew that the Orioles (8-25) were dead-red fastball hitters — Adam Jones jumped on a third-pitch fastball for a home run to center field on Friday — so the change up seemed a natural out-pitch. In fact, aside from the seven strikeouts he got using the change up, Cahill also induced three groundouts with it.

“That was one thing that’s always mixed in really well with him, and when he has the command like that, he’s pretty incredible,” Maxwell said.

Gausman, on the other side, threw a career-high nine shutout innings, striking out six, allowing just two hits and touching 98 with his 111th of 113 pitches.

“You’ve got to tip your cap to Gausman,” Melvin said. “He’s throwing 89-91 early in the game, and his last pitch I think was 98. It appeared like he was changing his speeds on his fastball. We knew him to be a power pitcher, and a guy who threw hard, but he’s throwing sinkers just below 90 early in the game, and he’s cutting loose a four-seamer at 97 at the end.”

After Cahill — whose 12 strikeouts tied him for the most by an Oakland pitcher since 2000 — exited, A’s relievers turned in yeoman’s work, with Yusmeiro Petit — who gave up a 4-1 lead the night before — going two scoreless and striking out four, despite allowing his first three walks of the season (one intentional).

“We had no problem [going back to Petit],” Melvin said. “We had some guys down today, so at the time, if Trevor gave us seven — and once he got to 100 pitches, we weren’t going to do that to him; he didn’t really have a spring training — I knew I’d probably have to use Yusi for two, and we had no problem with that, he had no problem with it.”

Santiago Casilla, too, tossed two shutout frames, and Daniel Coulombe struck out four in1 1/3. Chris Hatcher finished the top of the 12th, as Maxwell cut down pinch runner Craig Gentry trying to steal, and Adam Jones grounded out to third.

Cahill’s bounce-back start — he had allowed six earned runs in his last 11 innings — came at just the right time for the A’s, who optioned two of their five projected starters to Triple-A Nashville last month, and have only one other veteran in the rotation in recently re-acquired Brett Anderson. Of Oakland’s other three starters — Andrew Triggs, Sean Manaea and Daniel Mengden — none pitched in the Major Leagues before 2016.

“Those are the losses that are tough, but those are the wins that you can take a lot of momentum from,” Cahill said. “Our offense was quiet all night, but they did what they needed to do to win tonight. Hopefully, tomorrow, we come out and have a little less interesting of a ballgame.”

The win was the A’s 12th in their last 18 games, and third in their last four. Oakland finishes the series against the Orioles on Sunday at 1:05 p.m.