OAKLAND, Calif. – Nate Freiman singled home the winning run in the 18th inning against Mariano Rivera, lifting the Oakland Athletics to a 3-2 victory over the New York Yankees on Thursday for a three-game sweep.

John Jaso singled off Preston Claiborne (0-1) to start the rally.

Freiman ended the 5-hour, 35-minute game on New York’s getaway day to Anaheim for a weekend series with the Angels. A day game after a night game turned into a night game after a day game.

Moments before, Rivera issued just the 39th intentional walk of his 19-year career to Jed Lowrie.

ROYALS 10, RAYS 1: Elliot Johnson had a three-run homer for his second hit of an eight-run sixth inning, leading surging Kansas City to victory at St. Petersburg, Fla.

Johnson, who was traded to Kansas City by the Rays in February, led off the big inning with a single and chased Jeremy Hellickson (4-3) with his second homer of the season, both coming against Tampa Bay.

The Royals, who have won eight of nine, set a franchise record by holding an opponent to three runs or fewer in a 12th straight game.

JAYS 3, RANGERS 1: Edwin Encarnacion hit a tiebreaking two-run double in the eighth inning and Toronto handed host Texas its third straight loss.

The slumping Rangers wasted another solid outing by Yu Darvish, who has made five consecutive starts without a victory.

NATIONAL LEAGUE

CARDINALS 2, METS 1: Adam Wainwright became the major leagues’ first 10-game winner by pitching seven scoreless innings and sent Matt Harvey to his first loss of the season, leading St. Louis over host New York in a classic pitching matchup.

Wainwright (10-3) retired his first 11 batters before David Wright’s single, and allowed four hits with six strikeouts and two walks. Wainwright matched his career best by winning his fifth straight start, dropped his ERA to 2.18 and got his 1,000th career strikeout when Wright was called out on a first-inning curveball.

NATIONALS 5, ROCKIES 4: Ryan Zimmerman homered and drove in three runs, Ian Desmond got four hits and visiting Washington beat a depleted Colorado.

The Rockies lost four players and a coach, as well as the rubber match of the three-game series.

Outfielders Carlos Gonzalez and Dexter Fowler were injured early and shortstop Troy Tulowitzki left for an undisclosed reason in the eighth. Reliever Wilton Lopez and pitching coach Jim Wright were ejected in the seventh.

CUBS 6, REDS 5: Pinch-hitter Julio Borbon had a two-out RBI single in the 14th inning, helping host Chicago end Cincinnati’s record 12-game winning streak at Wrigley Field.

With the win, the Cubs avoided a four-game sweep.

GIANTS 10, PIRATES 0: Matt Cain allowed two hits over 62/3 innings and San Francisco pounded host Pittsburgh.

A year to the day after throwing a perfect game against Houston, Cain (5-3) was nearly flawless again. He struck out three and walked two, giving up a single to Garrett Jones in the fifth and a double to Andrew McCutchen in the seventh.

INTERLEAGUE

PHILLIES 3, TWINS 2: Cliff Lee allowed two runs in seven strong innings, Ben Revere had four hits and scored the go-ahead run, and Philadelphia rallied to win in Minnesota and snap a five-game losing streak.