DETROIT — All it took was Fried, Rice to get the Yankees back on track.
For seven innings Wednesday afternoon, Max Fried put on a masterclass, showing why the Yankees signed him to an eight-year, $218 million contract this offseason.
The left-hander struck out 11, walked none and scattered just five hits while out-dueling his former high school teammate, Jack Flaherty.
The only problem was that for six of those innings, it looked like it all might go for naught.
But before it was too late, Ben Rice ended a 16-inning scoring drought by smoking a two-run home run in the top of the seventh that, along with Fried’s gem, snapped a three-game losing streak as the Yankees beat the Tigers, 4-3, at Comerica Park.
Devin Williams nearly spoiled it all in the bottom of the ninth, entering with a four-run lead and letting three runs in.
Aaron Boone pulled Williams with the tying run on second and two outs, calling on Mark Leiter Jr., who needed two pitches to get a pop up to end it.
The Yankees (7-5) were in danger of getting swept to finish off this road trip, but Fried played the role of stopper.
His offense had scored 29 runs in his first two starts, but he had much less margin for error in his third start and delivered just what the Yankees needed.
So did Rice, who clobbered a 418-foot blast off of lefty reliever Tyler Holton to make it 2-0 with two outs in the seventh.
His third home run of the season, which came off the bat at 108.1 mph, cut through the cold to score the Yankees’ first runs since the eighth inning on Monday.
The Yankees added some insurance in the ninth, taking advantage of two hit batters and an error to score a pair of runs on Aaron Judge’s single that extended the lead to 4-0.
Most of the day was about the showdown between Fried and Flaherty, the two former rotation mates at the Harvard-Westlake School in Los Angeles who were starting against each other for the first time.
Flaherty, whom the Yankees nearly acquired at the trade deadline last summer before a concern with his physical popped up, tossed 5 ⅓ shutout innings while striking out nine and giving up three hits and three walks.
But Fried was even better, pitching like the ace the Yankees need him to be without Gerrit Cole.
He allowed three singles through the first four innings, with none of the runners getting past first base.
In the fifth, Zach McKinstry roped a triple to the left-field corner — which Jasson Domínguez had some trouble picking up cleanly — but Fried stranded him there by getting Justyn-Henry Malloy to whiff at a 95 mph fastball.
The only other Tiger to reach the rest of the day off Fried was Dillon Dingler, who led off the bottom of the seventh with a double.
But Fried responded by getting a harmless flyout and then striking out Javier Báez and Ryan Kreidler to end his outing in style.