ST. PETERSBURG, Fla. — Alex Cobb pitched neatly into the eighth inning and the Tampa Bay 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.

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 the break-even point 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.

Cobb (8-6) gave up six hits in 7 1/3 innings, striking out eight and walking one. He improved 4-0 in six career home starts against the Yankees.

After giving up a single to Derek Jeter that loaded the bases, Brad Boxberger struck Jacoby Ellsbury and Mark Teixeira.

Tampa Bay has held its opponents to three runs or fewer in a club-record 11 consecutive games.

Brandon McCarthy (4-2) gave up four runs and seven hits over 61/3 innings.

MARINERS 7, TIGERS 2: Robinson Cano homered, James Paxton won his sixth consecutive decision to start his career and surging Seattle won at Detroit in a matchup of American League playoff contenders.

Paxton (3-0) pitched six innings, allowing one run and five hits, to help Seattle win its fifth straight and jump a half-game ahead of Detroit in the race for the second AL wild card.

INDIANS 2, ORIOLES 1: Mike Aviles homered leading off the 11th inning to give Cleveland a win at home.

Aviles connected on a 1-2 pitch from Brian Matusz (2-3), driving it onto the home run porch in left field for just Cleveland’s second run in the past 22-plus innings. The Indians were shut out 1-0 by Arizona in 12 innings on Wednesday night.

ROYALS 6, TWINS 5: Josh Willingham returned to Target Field and hit a bases-clearing double in Kansas City’s five-run fourth inning, and the surging Royals hung on to win at Minnesota.

Kansas City has won 11 of 12 and sits atop the AL Central.

NATIONAL LEAGUE

DIAMONDBACKS 3, MARLINS 2: Aaron Hill and Cliff Pennington hit homers in the first inning and Arizona won at Miami.

Trevor Cahill (3-8) pitched 6 2/3 innings allowing two runs and six hits for the Diamondbacks. Addison Reed worked the ninth for his 29th save in 34 chances.

Marlins starter Brad Hand (2-5) allowed three runs in seven innings.

METS 3, CUBS 2: Zack Wheeler struck out 10 in a gritty performance, Eric Campbell hit a three-run homer and host New York beat Chicago.

Wheeler (8-8) threw a career-high 120 pitches in 6 2/3 innings, allowing two runs and four hits. He walked four and hit a batter but overpowered the Cubs in improving to 5-0 in his last nine starts.

NATIONALS 5, PIRATES 4: Bryce Harper and Adam LaRoche each drove in two runs, leading host Washington to its fourth straight.

CARDINALS 4, PADRES 2: Lance Lynn pitched six strong innings and host St. Louis won its third straight win.

INTERLEAGUE

BRAVES 7, ATHLETICS 2: Freddie Freeman hit a three-run homer, one of four by host Atlanta, and the Braves won the opener game of the interleague series.

Justin Upton and Evan Gattis hit homers off Jason Hammel (1-5) in the second inning.