NEW YORK (AP) — After Mariano Rivera blew a third straight save for the first time in his famed career, Brett Gardner homered with two outs in the ninth inning to lift the New York Yankees over the Detroit Tigers 5-4 Sunday for their first series win in more than a month.

Rivera (3-2) gave up another homer to a limping Miguel Cabrera and a drive to Victor Martinez in the top of the ninth, tying it at 4 and turning Alex Rodriguez's first homer of the season into a footnote.

Gardner connected off Jose Veras (0-5).

Rivera has a record 643 saves, but had never failed three in a row in 1,087 relief appearances coming in.

ROYALS 4, RED SOX 3

KANSAS CITY, Mo. (AP) — James Shields earned his first home win in more than three months, Alex Gordon homered and the Kansas City Royals beat Boston.

The Royals improved to 18-5 since the All-Star break, winning seven consecutive series.

Shields (7-8) gave up three runs and seven hits over seven innings. Greg Holland got his 32nd save in 34 opportunities.

Gordon connected off John Lackey (7-10) for his third homer in five games. Lackey is 0-4 in his past five starts.

The contending Royals announced a trade after the game, getting veteran infielder Jamey Carroll from Minnesota for cash or a player to be named.

RANGERS 6, ASTROS 1

HOUSTON (AP) — Martin Perez threw a four-hitter for his first career complete game, leading the Texas Rangers past Houston for their seventh straight victory.

Chris Carter ruined Perez's shutout bid with a home run with two outs in the ninth inning.

Alex Rios had two hits, drove in a run and scored twice in his second game with the Rangers, who have won 12 of their last 13 games. Adrian Beltre also had two hits.

Perez (5-3) struck out a career-high eight while walking two in earning his second straight win.

Dallas Keuchel (5-7) allowed six runs and eight hits with eight strikeouts in 8 2-3 innings.

ATHLETICS 4, BLUE JAYS 3

TORONTO (AP) — Alberto Callaspo hit a tiebreaking two-run double in the eighth inning, Brandon Moss had a two-run homer and the Oakland Athletics beat Toronto.

Oakland outfielder Josh Reddick, who homered five times in the first two games of the series, was moved up to fifth in the order but failed to connect again. He went 1 for 3 with two walks.

Callaspo's hit came against Darren Oliver (3-3).

Ryan Cook (4-2) pitched 1 1-3 innings for the win. Grant Balfour worked around Brett Lawrie's RBI double in the ninth for his 30th save in 31 chances. Balfour got Jose Reyes to ground out with the bases loaded to end it.

INDIANS 6, ANGELS 5

CLEVELAND (AP) — Michael Bourn drove in the go-ahead run with a seventh-inning single, and the Cleveland Indians rallied from a five-run deficit to break a six-game losing streak by the Los Angeles Angels.

The Indians, held to one hit through five innings, got back in the game in the sixth on two-run homers by Nick Swisher and Mike Aviles, who entered the game in the third after shortstop Asdrubal Cabrera was ejected.

Carlos Santana's leadoff homer in the seventh off J.C. Gutierrez (0-3) tied the game.

Matt Albers (3-1) pitched 1 2-3 innings and Chris Perez recorded his 18th save as the Indians' bullpen threw 4 2-3 scoreless innings.

MARINERS 2, BREWERS 0

SEATTLE (AP) — Felix Hernandez blanked Milwaukee on four hits for eight innings and the Seattle Mariners topped the Brewers.

Hernandez (12-5) struck out nine and walked one in his first career appearance against the Brewers. The 2010 AL Cy Young winner leads the league with a 2.28 ERA and is second with 178 strikeouts.

Danny Farquhar worked the ninth for his fourth save.

Wily Peralta (8-12) pitched a complete game and allowed four hits. He walked none and struck out four.

TWINS 5, WHITE SOX 2

CHICAGO (AP) — Kevin Correia pitched seven shutout innings, Brian Dozier and Joe Mauer backed him with home runs and the Minnesota Twins beat the Chicago White Sox.

The Twins took three of four games in the series and have won nine of 12 against the White Sox this season.

Adam Dunn and Conor Gillaspie hit solo home runs off Casey Fien in the White Sox ninth.

Dozier's three-run homer off Jose Quintana (6-4) gave the Twins a 3-0 lead in the fifth. After Jamey Carroll singled, Mauer hit his ninth homer.

Correia (8-8) struck out seven, tying a season high. He allowed five hits and one walk.