Alex Cobb pitched neatly into the eighth inning and the Rays became just the fourth team in major league history to reach .500 after falling 18 games under in the same season, beating the New York Yankees 5-0 Friday night.
"Really proud of the boys," manager Joe Maddon said. "It was not easy."
The Rays won their third in a row and sent New York to its fifth straight loss.
Tampa Bay also accomplished the comeback feat in 2004 when known as the Devil Rays. The 1899 Louisville Colonels and 2006 Florida Marlins have also gotten back to .500 after dropping 18 under.
The Rays, now 61-61, were 24-42 on June 10. They are trying to become the first club to finish with a winning record after being so far under.
"It started with Joe and not letting us believe that we were that team," Cobb said. "It's mind-boggling that we went through the stretch we did, but we're back on track now."
Cobb (8-6) gave up six hits in 7⅓ innings, striking out eight and walking one. He improved 4-0 in six career home starts against the Yankees.
"Fabulous," Maddon said.
Cobb landed awkwardly on his left foot after fielding Brett Gardner's grounder in the sixth. He said the foot is fine, but expects some stiffness Saturday.
After giving up a single to Derek Jeter that loaded the bases, Brad Boxberger struck Jacoby Ellsbury and Mark Teixeira.
"We didn't score," New York manager Joe Girardi said. "That was the problem."
Tampa Bay has held its opponents to three runs or less in a club-record 11 consecutive games.
Brandon McCarthy (4-2) gave up four runs and seven hits over 6⅓ innings. New York has scored a total of seven runs during its current skid, which includes a pair of shutouts.
The Rays took a 2-0 lead in the first on RBI grounders by Evan Longoria and James Loney.
Loney homered in the eighth when Esmil Rogers tried to quick-pitch him.
Curt Casali singled home a run and Ben Zobrist hit the Rays' third RBI grounder of the game during the seventh as Tampa Bay took a 4-0 lead.
Yankees: C Brian McCann could be activated from the seven-day concussion list this weekend. ... RHP Masahiro Tanaka (right elbow) will have his first bullpen session Saturday.
Rays: CF Desmond Jennings (sore left shoulder) was back in the starting lineup after missing two games.
Boxberger has allowed just one hit in 56 at-bats against left-handed hitters since May 21.
"I don't want [to talk about it]," Maddon said of the right-hander's success. "Let them figure it out."
Jeter, who is retiring after the season, had two singles in four at-bats after getting a partial standing ovation before his first at-bat.
Rays LHP Drew Smyly (7-10) and Yankees rookie RHP Shane Greene (3-1) are Saturday's scheduled starters. Smyly will make his first home start since being obtained from Detroit in a three-team deal July 31 that sent Tampa Bay ace David Price to the Tigers.
Yankees Lose Fifth Straight
Alex Cobb struck out eight over 7 1/3 scoreless innings as the Rays blanked the Yankees 5-0.