NEW YORK _ The perfect game disappeared with two outs in the sixth and the shutout went kaput with two outs in the seventh.
And that was about all when it comes to blemishes on Masahiro Tanaka's ledger Friday night.
Turning in one of the best performances by any Yankee pitcher this season, Tanaka struck out the first five he faced and seven of the first nine in leading the Yankees to a 6-1 victory over the Rays in front of 40,470 at Yankee Stadium. The victory moved the Yankees back into first place in the AL East, one-half game in front of the Red Sox.
Tanaka (8-9, 5.09 ERA), who seldom has resembled the ace he's been the previous three years, allowed two hits and struck out a career-best 14.
He was backed by three home runs, one each by Brett Gardner, Aaron Judge and Clint Frazier.
Gardner, who won Thursday night's game with a walk-off homer in the 11th, led off Friday with his 19th homer. Judge destroyed an Austin Pruitt fastball in the fourth for his 33rd home run, which made it 2-0, and Frazier hit one an estimated 455 feet to left-center in the fifth off Pruitt, the rookie's fourth homer, making it 5-0.
The Yankees (55-46)\ won their fifth straight and seventh out of eight.
Much of the crowd, and probably quite a few Yankees as well, thought they just might see some history Friday as Tanaka took a perfect game into the sixth and retired the first two batters of the inning.
But Adeiny Hechavarria, the No. 9 hitter, swatted a first-pitch splitter back up the middle for the Rays' first hit.
The shutout was intact until Lucas Duda, acquired from the Mets the day before and playing in his first game as a Ray, homered into the second deck in right with two outs in the seventh to make it 5-1.
Tanaka, with a devastating split and slider, his two most important pitches, struck out the side in his first inning and his last. The right-hander, after striking out Tim Beckham to end the eighth, with his 109th and final pitch, received a thunderous ovation as he walked off the mound.
It was an especially impressive effort given what the Rays (53-51) had done in two previous outings against Tanaka. They scored seven runs and had eight hits, including two homers, in the season opener in St. Petersburg and tattooed the pitcher for six runs and nine hits, including three homers, on May 20, again in St. Pete.
David Robertson pitched a scoreless ninth to polish off the 2 hour, 23-minute game.
Gardner started his night Friday the way he ended Thursday, driving a home run to right off Pruitt (5-2, 6.63) for an early lead.
Judge, in an 8-for-47 slide to start the second half, with 20 strikeouts, fell behind 1-and-2 before blasting a 94-mph fastball to left for his 33rd homer of the season, tying him with Giancarlo Stanton for most in the majors.
Todd Frazier walked with one out in the fifth and Gardner walked with two outs, which brought up Clint Frazier. The 22-year-old, who brought an .839 OPS into the night, annihilated a 0-and-1 slider to left.
Didi Gregorius' RBI single in the eighth made it 6-1.