Grayson Rodriguez pitched against the Rangers’ Jacob deGrom, the Angels’ Shohei Ohtani and the Rays’ Shane McClanahan in his first 12 major league games.

Why not add six-time All-Star Gerrit Cole to that list? Oh, and factor in Aaron Judge’s return from the injured list and a 2 1/2-hour rain delay.

No problem at all for Rodriguez.

He spun a career-high 6 1/3 shutout innings for the Orioles, holding the Yankees to three hits while striking out four. Anthony Santander provided the only run of the night in heroic fashion, hitting a walk-off home run as the Orioles beat the Yankees 1-0 to open the three-game series.

The Baltimore Banner thanks its sponsors. Become one.

“That was just such an amazing, well-pitched game from both sides,” Orioles manager Brandon Hyde said.

Rodriguez was firing from the start. Six of his eight pitches in the first inning registered above 98.7 mph. He got Anthony Rizzo swinging on a 100.2 fastball to end the frame.

He stayed the course through the second and third, efficiently getting through the lineup the first time on just 28 pitches. He didn’t allow a baserunner until the fourth, when Judge walked, or a hit until Rizzo singled on an outside fastball.

As Rodriguez worked through the sixth, his pitch count began to climb. He’s been in this spot before, stellar the first time through the order and less so as the batters see him for the second and third times. Rodriguez has made it 5 2/3 innings twice.

On Friday, though, he finally got through the sixth, winning an 11-pitch at-bat with Rizzo that resulted in a groundout to end the inning. Rodriguez even pitched into the seventh, striking out Giancarlo Stanton but giving up a hit to DJ LeMahieu to end his night.

The Baltimore Banner thanks its sponsors. Become one.

“He’s just scratching the surface of the type of pitcher he can be,” Hyde said. “He showed tonight what he has. ... Presence, command against a really tough lineup.”

It wasn’t just the fastball that was working. Rodriguez changed speeds, his changeup, his most-used secondary pitch, dipping to the low 80s. He got three whiffs on that pitch, eight on the fastball. His slider is also improving.

But Cole is an ace for a reason. He matched Rodriguez every step of the way, giving up just three hits in seven shutout innings, walking none.

“It was electric,” Rodriguez said of their pitching duel. “Getting to see him pitch once at Yankee Stadium but another thing to go up against him. It was a lot of fun. It was a competitive battle.”

The game remained scoreless heading into the bottom of the ninth, when Santander hit Tommy Kahnle’s changeup 425 feet into right center. There was no doubt about this one. The Yankees defenders started heading inside before the ball even landed in the stands.

The Baltimore Banner thanks its sponsors. Become one.

Santander pointed to his teammates as he started running the bases, signaling to get the Gatorade bath ready. They were there at home plate when Santander crossed, dousing their walk-off hero.

“That was amazing,” Santander said. “Giving the team a chance to win right there against a good team is really good.”

danielle.allentuck@thebaltimorebanner.com