SAN FRANCISCO -- Madison Bumgarner pitched a one-hitter and the San Francisco Giants beat the Colorado Rockies 3-0 on Tuesday night to snap a three-game losing streak.

The two-time All-Star retired the first 21 batters before Justin Morneau doubled down the right field line to end the bid for perfection. That was the only baserunner Bumgarner (15-9) gave up. He fanned the next three hitters and matched his career high of 13 strikeouts.

San Francisco's husky left-hander was attempting to follow Tim Lincecum's no-hitter at AT&T Park on June 25 against San Diego with another milestone. His 103-pitch gem helped the Giants remain in a wild-card spot.

Buster Posey homered twice for San Francisco.

PHILLIES 3, NATIONALS 2

PHILADELPHIA (AP) -- Freddy Galvis and Darin Ruf homered and Carlos Ruiz drove in the go-ahead run with an eighth-inning sacrifice fly.

Ken Giles (3-1) struck out the side in a scoreless eighth to help the Phillies to their fifth win in six games. Jonathan Papelbon pitched a 1-2-3 ninth for his 33rd save in 35 chances.

Asdrubal Cabrera homered for the Nationals, who lost consecutive games for the first time since Aug. 4-5.

Gio Gonzalez (6-10) gave up three runs on six hits in six innings to extend his winless streak to nine starts.

PIRATES 5, CARDINALS 2

PITTSBURGH (AP) -- Pinch-hitter Ike Davis launched a tiebreaking, three-run homer off Seth Maness in the eighth inning.

The Pirates won after reigning NL MVP Andrew McCutchen left in the fifth inning because of discomfort in his left ribs. Recently on the disabled list because of a rib problem, the centre fielder ran into the wall earlier in the game.

Davis sent a 2-2 pitch from Maness (5-3) deep over the fence in right-centre for his ninth home run of the season and his third as a pinch-hitter.

Tony Watson (9-1) couldn't protect an early lead after six-plus dominant innings by starter Gerrit Cole, but picked up the win. Mark Melancon worked the ninth for his 23rd save.

Josh Harrison homered for the Pirates.

METS 3, BRAVES 2

NEW YORK (AP) -- Juan Lagares hit a two-run homer, sending Dillon Gee and the Mets to the win.

Gee (5-6) stopped the longest losing streak of his career at five games, outpitching Alex Wood (9-10) in the opener of a three-game series. Lagares, one of the best defensive centre fielders in baseball, scurried from gap to gap and finished with seven putouts.

One of them was spectacular -- he robbed Wood of a base hit with a diving, tumbling grab in shallow centre to end the third inning.

Streaking slugger Justin Upton went 3 for 3 with an RBI double and a walk for Atlanta.

CUBS 3, REDS 0

CINCINNATI (AP) -- Travis Wood pitched six innings of two-hit ball against his former team for his first win in two months, leading the Cubs past Johnny Cueto and Reds.

Arismendy Alcantara hit a two-run shot and Anthony Rizzo connected for his 30th homer for Chicago, which has won four in a row for the first time since June 30-July 4.

Cincinnati was shut out for the 12th time this season. Cueto (15-8) struck out eight in 6 1-3 innings in his second straight loss after winning seven consecutive decisions.

Wood (8-11) struck out five and walked one in his first victory since he pitched eight innings in a 3-0 win at Philadelphia on June 15.

ROYALS 2, TWINS 1

KANSAS CITY, Mo. (AP) -- Alex Gordon hit a two-run homer in the ninth inning, helping the Royals avoid their first three-game skid since mid-July.

The Royals had been shut down all night by Ricky Nolasco, who scattered three hits over seven innings. But after going quietly in the eighth, the AL Central leaders managed to break through against closer Glen Perkins (3-1) in the ninth.

Alcides Escobar led off with a blooper to shallow right for a single, and Gordon followed by swatting the second pitch he saw over the right-field wall for his 10th homer.

Wade Davis (7-2) earned the win with a perfect ninth inning in relief.

ASTROS 4, ATHLETICS 2

HOUSTON (AP) -- Chris Carter hit his 32nd homer, a three-run drive in the eighth inning.

Oakland starter Jason Hammel had retired 10 straight batters when he was replaced by Luke Gregerson (3-3) for the eighth. Robbie Grossman reached on an error by first baseman Stephen Vogt with one out and Gregerson hit Jose Altuve with a pitch.

Carter then launched a 90 mph fastball onto the tracks atop the wall in left field to put Houston on top.

Josh Fields (4-6) pitched a scoreless eighth for the win and Chad Qualls did the same in the ninth for his 15th save.

ORIOLES 4, RAYS 2

BALTIMORE (AP) -- Jonathan Schoop singled in the go-ahead run in the sixth inning and Caleb Joseph had two RBIs as the Orioles beat the fading Rays.

Nelson Cruz had two hits and drove in a run for the AL East-leading Orioles, who improved to 10-4 against Tampa Bay. Baltimore relievers gave up one hit over the final 4 1-3 innings.

Evan Longoria had two RBIs for the Rays, who have lost seven of 10 since reaching the .500 mark on Aug. 15. Tampa Bay stranded nine and had two runners thrown out at the plate.

TIGERS 5, YANKEES 2

DETROIT (AP) -- Rick Porcello pitched eight impressive innings to set a career high for victories, and the Tigers snapped New York's five-game winning streak.

Porcello (15-8) joined teammate Max Scherzer as the American League's only 15-game winners, allowing two runs and nine hits. The 25-year-old right-hander threw a shutout in his previous start against Tampa Bay, and he blanked the Yankees until Jacoby Ellsbury's homer in the fifth.

Ellsbury added another solo shot in the eighth.

Joe Nathan pitched a perfect ninth for Detroit for his 28th save in 34 chances. First baseman Miguel Cabrera made two nice plays to close out the win.

Brandon McCarthy (5-3) allowed five runs and nine hits in 6 1-3 innings.

RED SOX 11, BLUE JAYS 7, 11 INNINGS

TORONTO (AP) -- Mike Napoli and Allen Craig both homered in a seven-run 11th inning, Dustin Pedroia homered and had four RBIs for the Red Sox.

Boston broke away from a 4-4 tie for its second straight victory following an eight-game losing streak. Toronto fell to 6-16 in August and, at 66-66, dropped to .500 for the first time since May 15.

Mookie Betts singled off Casey Janssen (3-2) to begin the 11th and was called out at second on Christian Vazquez's sacrifice, with the call overturned after a challenge by Red Sox manager John Farrell. Janssen was charged with an error when he bobbled Brock Holt's bunt, loading the bases for Pedroia, who singled through the drawn-in infield to score a pair.

Sergio Santos came on and struck out Yoenis Cespedes before Napoli, hit a towering three-run homer into the fifth deck. It's the 17th upper deck homer in the 25-year history of Rogers Centre, and the seventh by an opponent.

Daniel Nava doubled before Craig homered, his first with Boston.

INDIANS 8, WHITE SOX 6, 10 INNINGS

CHICAGO (AP) -- Zach Walters hit a two-run home run in the 10th inning. Pinch-hitter Lonnie Chisenhall doubled to lead off the 10th against Jake Petricka (0-4), and after failing to sacrifice Chisenhall to third, Walters hit a 3-2 pitch well into the right-field bleachers to give the Indians the lead.

Bryan Shaw (5-3) pitched 2 1-3 scoreless innings in relief for the win, keeping Cleveland 5 1/2 games behind Kansas City in the AL Central.

Chicago lost its seventh straight and saw Petricka give up a go-ahead home run in his second consecutive appearance after allowing Brian McCann's 10th inning walk-off Sunday against the Yankees.

MARINERS 5, RANGERS 0

SEATTLE (AP) -- James Paxton pitched into the seventh in a bounce-back start, and Robinson Cano hit his 12th home run.

Paxton threw a career-high 118 pitches and came an out away from tying his career high with seven innings pitched. The rookie lowered his ERA to 1.71, the best mark for a pitcher in his first 11 major league starts since 1990.

Cano's towering two-out home run in the first opened the scoring and was his 71st RBI of the year.

Seattle broke open a two-run game in the fifth, with the big blow coming on a double by Endy Chavez, which drove in a pair. Dustin Ackley scored Austin Jackson later in the inning with a single.

ANGELS 8, MARLINS 2

ANAHEIM, Calif. (AP) -- Mike Trout had an RBI double and Albert Pujols added a two-run single during Los Angeles' five-run fourth inning. The Angels regained sole possession of the majors' best record.

Matt Shoemaker (13-4) yielded two hits over seven scoreless innings as the Angels (78-53) moved one game ahead of their AL West rival Oakland Athletics, who lost to Houston.

Trout slowed his August slump with three hits, and Efren Navarro drove in two runs as the Angels pounded 16 hits in their 10th victory in 14 games.

Nathan Eovaldi (6-9) gave up 10 hits in 3 1-3 innings while dropping his third straight start for the Marlins, who have lost four of six.

DODGERS 9, DIAMONDBACKS 5

PHOENIX (AP) -- Matt Kemp homered and the Dodgers scored six runs in the fourth inning, thanks in large part to two overturned out calls.

With the game tied at 2, the Dodgers hit five consecutive singles off starter Trevor Cahill (3-9) in the fourth. The Dodgers led 4-2 when A.J. Ellis singled to centre field. The throw beat Carl Crawford to home plate, but an umpire initiated a review on whether catcher Miguel Montero was blocking the plate. That led to the crew seeing that the ball was in his other hand. The initial out call was overturned.

The next batter, pitcher Roberto Hernandez, was called out at first base on a bunt past the pitcher's mound. But Mattingly challenged that call, and Hernandez was ruled safe, allowing Justin Turner to score. Dee Gordon'S single and A sacrifice fly from Adrian Gonzalez brought in the last two runs of the inning.

Hernandez (8-9) made it through six innings and allowed three runs on six hits to improve to 2-1 with the Dodgers.

PADRES 4, BREWERS 1

SAN DIEGO (AP) -- Tyson Ross pitched 6 1-3 strong innings, Abraham Almonte had two RBIs and the Padres snapped the Brewers' five-game road winning streak.

Ross (12-12), the Padres' lone All-Star, extended his franchise record with his 13th consecutive quality start. He gave up one run and four hits with six strikeouts and two walks.

Joaquin Benoit pitched the ninth for his ninth save in 10 chances.

Ross is 6-6 with a 1.96 ERA during his quality start streak, which dates back to June 21. He has 86 strikeouts and 24 walks in that stretch.

Jimmy Nelson (2-5) worked five innings for Milwaukee and allowed four runs -- two earned -- on five hits, with seven strikeouts in losing his third straight.