Clint Frazier #77 of the Yankees follows his three run...

Clint Frazier #77 of the Yankees follows his three run homer against the Baltimore Orioles in the eighth inning at Oriole Park at Camden Yards on April 6, 2019, in Baltimore, Maryland.  Credit: Getty Images/Rob Carr

BALTIMORE — A triple crown of bad baserunning, bad defense and too little offense nearly did in the Yankees on Saturday night — until Clint Frazier saved them.

He failed to deliver in a key spot in the sixth inning but more than made up for it with two outs in the eighth, hitting a three-run homer that sent the Yankees to a 6-4 win over the Orioles in front of 27,504 at Camden Yards.

“We gave away too many outs tonight,” Aaron Boone said. “Defensively, on the bases, but one thing our guys do really well is compete.”

The Yankees (4-4), who got two mammoth homers from Aaron Judge but committed a couple of blunders on the bases — notably Gary Sanchez getting picked off for a second straight game, this time off third to short-circuit a bases-loaded, none-out situation in the sixth — looked as if they might take an indescribable defeat as the eighth began.

After Greg Bird flied out against lefty Paul Fry, righthander Miguel Castro came in to face Sanchez, who flied to right. But Gleyber Torres walked and DJ LeMahieu singled for his third hit of the night to put runners at the corners.

That gave Frazier, who struck out as a pinch hitter with two on in the sixth, a second chance, and he delivered. With the count 2-and-2, Frazier pounced on a slider and rocketed it deep to left for his first homer of the season, making it 6-4. Frazier showed the bat speed that general manager Brian Cashman has called “legendary,’’ and after the ball left his bat, Orioles catcher Pedro Severino ripped off his mask in disgust.

“All of last year was tough for me, tough for everyone that was close with me,” said Frazier, who missed the majority of 2018 while dealing with lingering effects of a concussion suffered during spring training. “I haven’t been able to contribute to the team the way I’ve wanted to. To finally be able to do that tonight feels good.”

The shot sent more than a few from the Yankees’ dugout onto the field in celebration. “That just shows his mental toughness,” Judge said. “Another big situation with the game on the line, he produced for us. That’s what that kid does.”

Jonathan Holder, who had done a mostly good job after coming on for J.A. Happ with two on and one out in the fifth, started the bottom of the seventh protecting a 3-2 lead. He hit Cedric Mullins on the foot, Jonathan Villar singled and Boone brought in Adam Ottavino to face Joey Rickard.

In a move that had many in the crowd booing, except the sizable contingent of Yankees fans, Orioles manager Brandon Hyde sent up the lefthanded-hitting Chris Davis to pinch hit. Davis — 0-for-19 with 11 strikeouts to start the season  and 0-for-40 dating to last Sept. 14 after going 0-for-2 Saturday — managed to roll over a pitch and chop it to first. Bird bobbled it and then fired home but was too late to get the sliding Mullins. That tied it at 3.

After Trey Mancini, who homered off Happ in the first inning, popped out, Villar stole third. A sacrifice fly to center by pinch hitter Rio Ruiz gave the Orioles a 4-3 lead.

Given a 6-4 lead, Ottavino departed with one on and two outs in the eighth, replaced by Chad Green, who hit Mullins. Green got out of a bases-loaded jam when Davis hit a ground smash that Bird fielded to end the inning. Aroldis Chapman struck out two with a scoreless ninth.

Judge, 0-for-5 with four strikeouts Thursday, entered the night without a home run this season but quickly changed that, driving a 2-and-2 fastball over the centerfield fence in the first. He unloaded again with even more ferocity in the third, blasting a hanging full-count slider to even deeper center for a two-run blast that made it 3-1.

Judge has 15 home runs and 37 RBIs in 43 games against the Orioles.

“I just got some good pitches to hit,” he said, “that I didn’t miss.”

More Yankees headlines

Newsday LogoYour Island. Your Community. Your News.Digital AccessOnly 25¢for 5 months