BOSTON (AP) -- The Detroit Tigers have the best pitcher in the American League and the best hitter in baseball.
Jon Lester was better than both.
Boston's ace outdueled Max Scherzer and retired Miguel Cabrera with the bases loaded as the Boston Red Sox beat Detroit 2-1 on Tuesday night in a well-played game between two division leaders.
It ended the Tigers' right-hander's chance to become just the second pitcher to open a season with a 20-1 record.
"We all know who we're facing tonight and what he's done this season," Lester said, "but I can't worry about Max Scherzer. I have to worry about the other nine guys in the lineup."
The Tigers lead the AL in hitting and Cabrera leads all batters with a .355 average.
So the Red Sox were in big trouble when he came up with the bases loaded and two outs in the fifth inning with Detroit leading 1-0.
Lester's first two pitches were balls, but he recovered to get Cabrera to ground to shortstop Stephen Drew for a forceout at second base.
"The key to the game," Red Sox manager John Farrell said.
"Obviously, I don't want to be in that situation with him up," Lester said, "the best hitter on the planet. You're trying to really minimize damage."
Boston scored on Will Middlebrooks' two-run single in the fifth after Detroit's Jose Iglesias doubled in a run in the second.
Koji Uehara pitched the ninth for his 17th save in 20 opportunities and extended his scoreless streak to 25 innings as Boston won for the eighth time in 10 games.
Lester (13-8) lowered his ERA to 1.71 in his past six starts. He allowed one earned run and eight hits with a season-high nine strikeouts and no walks.
Scherzer (19-2), who won his first 13 decisions, lost for the first time since July 13 when the Texas Rangers beat him 7-1.
"For me, it's a team thing," he said. "If I win 20, it's a team achievement."
Scherzer can thank his hitters for many of those wins. The 7.17 runs per nine innings they scored for him going into his 28th start on Tuesday were the most among all AL pitchers.
But Lester shut them down.
"He was totally different than the first time we faced him," Torii Hunter said. "He was the Jon Lester of old."
Lester struggled for nearly two months before the All-Star game. In one game, he allowed five runs in 52⁄3 innings against the Tigers. But he's 5-2 since the break.
"It was a well-pitched game on both sides," Farrell said. "We didn't have anything going against Scherzer until the two-out base hit by Will for the two RBIs. Jon was very good when we needed it."
Roger Clemens is the only pitcher to start off at 20-1 and ended up 20-3 with the New York Yankees in 2001. Rube Marquard was the only other pitcher with a 19-1 record, but lost his next decision in 1912 with the New York Giants.
Yankees 6, White Sox 4
NEW YORK -- Eduardo Nunez's two-run double capped a five-run eighth inning for New York.
Pinch-hitter Curtis Granderson tied the score with an RBI single off reliever Donnie Veal and New York went on to win for the 12th time in 14 home games.
Alexei Ramirez hit a two-run triple and Alejandro De Aza homered for the last-place White Sox who dropped their fifth straight.
Alfonso Soriano's two-run single off Nate Jones (4-5) cut the deficit to 4-3.
Boone Logan (5-2) pitched a perfect eighth, and Mariano Rivera earned his 40th save.
Derek Jeter finished with two hits, giving him 3,315 to pass Eddie Collins (3,313) for ninth on the career list.
Royals 4, Mariners 3
KANSAS CITY, Mo. -- Salvador Perez drove in Mike Moustakas with two outs in the eighth inning for Kansas City, which survived after blowing a three-run lead.
Billy Butler grounded into a double play against reliever Yoervis Medina (4-4) when Moustakas legged out a double to center in the eighth. Perez followed with a single to left, and Moustakas had just enough time for a headfirst slide ahead of Endy Chavez's throw to home.
Luke Hochevar (4-2) got two outs in the eighth to leave runners stranded on second and third, and Greg Holland pitched a perfect ninth for his 31st straight save and 38th on the year.
Perez homered and finished with three hits for the Royals, who have won three straight and eight of their last 10. Alex Gordon also hit a solo shot and Butler drove in a run for Kansas City.
Kyle Seager hit a two-run shot for the Mariners, who have lost three straight.
Twins 9, Astros 6, 12 innings
HOUSTON -- Clete Thomas scored the go-ahead run on a wild pitch in the 12th inning and Darin Mastroianni added a two-run double for Minnesota.
Thomas reached on a fielder's choice and went to third on Josmil Pinto's double. Kevin Chapman (0-1) then uncorked a wild pitch with pinch-hitter Ryan Doumit at the plate.
Mastroianni provided a couple of insurance runs when he doubled with two outs as Minnesota recovered after Glen Perkins blew a save opportunity in the ninth.
Brian Dozier and Trevor Plouffe homered for Minnesota, which has won three straight. Plouffe had four hits and Mastroianni went 3 for 6 with three RBIs.
Brandon Barnes had three hits and five RBIs for the Astros, including a tying three-run homer off Perkins with two outs in the ninth.
Caleb Thielbar (3-2) pitched two hitless innings for the win and Josh Roenicke finished for his first save.
Rays 7, Angels 1
ANAHEIM, Calif. -- Matt Moore pitched into the sixth inning in his return from the disabled list, and Tampa Bay got home runs from Desmond Jennings and Yunel Escobar.
Moore (15-3) won his seventh straight decision, yielding an unearned run and four hits in 51/3 innings as the Rays snapped a five-game losing streak. The All-Star left-hander, who missed the entire month of August because of elbow soreness, won six straight starts before getting a no-decision on July 28 at Yankee Stadium.
Roberto Hernandez struck out his first five batters after relieving Moore, and seven altogether in 32/3 perfect innings to record his first save in eight major league seasons. It was only his second relief outing since his rookie season with Cleveland in 2006.
Los Angeles left-hander Jason Vargas (8-6) was charged with five runs and 10 hits in four-plus innings.
Rangers 5, Athletics 1
OAKLAND, Calif. -- Martin Perez allowed one run over seven innings to win his sixth straight start and Mitch Moreland homered to move Texas back into sole possession of first place in the AL West.
After falling into a tie for first with the A's when they lost the series opener, the Rangers bounced back behind another strong performance from Perez (9-3) and are assured of leaving Oakland for the final time in the regular season with at least a share of the division lead.
Bartolo Colon (14-6) allowed three unearned runs in the fifth inning following his own error. Colon is winless in five starts since July 26 with a DL stint in the middle of that stretch.
The Rangers scored three unearned runs in the fifth to take a 4-1 lead with help from two comebackers that Colon could not handle. Adrian Beltre added a run-scoring groundout and A.J. Pierzynski blooped an RBI single.
Alex Rios added a leadoff homer in the eighth to make it 5-1.
Pirates 4, Breweres 3
MILWAUKEE -- Pinch-hitter Travis Snider homered in the ninth inning to lift Pittsburgh to a 4-3 win over the Milwaukee Brewers on Tuesday night that clinched the Pirates' first non-losing record in 21 seasons.
Snider drove a 2-2 pitch from Jim Henderson (3-5) over the wall in center for his second pinch-hit homer of the season. He also accomplished the feat against the Chicago Cubs on May 21.
It was victory No. 81 for Pittsburgh, ensuring it will not finish with a losing record for the first time since it went 96-66 in 1992. More importantly, it boosted the Pirates' lead in the NL Central to two games over St. Louis.
Vin Mazzaro (7-2) pitched two innings for the win and Mark Melancon got three outs for his 11th save, striking out Khris Davis with a runner on second to make it four straight wins for Pittsburgh at Miller Park for the first time since 2002. The Pirates lost 44 of 51 games in Milwaukee from 2007-2012.
Jean Segura had two hits and Jonathan Lucroy drove in two runs for Milwaukee, which has lost five in a row.
Dodgers 7, Rockies 4
DENVER -- Ricky Nolasco pitched six strong innings, Carl Crawford had three hits and the Dodgers earned their sixth consecutive win.
Crawford singled in a pair of runs in the second to spark the offense in the absence of injured catalyst Yasiel Puig. The Cuban slugger was rested a day after he aggravated a right knee strain.
Nolasco (12-9) allowed two runs and five hits in improving to 7-1 with a 2.27 ERA in 11 starts since coming to Los Angeles on July 6 in a trade with Miami.
Nick Punto added four singles for the NL West-leading Dodgers.
Jhoulys Chacin (13-8) allowed four runs in seven innings in losing to the Dodgers for the first time in four starts this season.
Nationals 9, Phillies 6
PHILADELPHIA -- Wilson Ramos hit a three-run homer and Corey Brown also went deep to back Gio Gonzalez, leading Washington to the victory.
Still clinging to postseason hopes, the Nationals overcame a sloppy all-around effort that included three errors, four unearned runs and four wild pitches. They remained 71/2 games behind Cincinnati for the second wild-card spot.
Gonzalez (9-6) gave up five runs -- one earned -- and five hits, striking out six in 52/3 innings. The lefty has two straight wins after going seven starts without one.
Phillies rookie Ethan Martin (2-4) allowed five runs and four hits in 42/3 innings.
Cody Asche was 3 for 4 with a homer and three RBIs for Philadelphia.
Rafael Soriano tossed a scoreless ninth for his 37th save in 43 chances.
Braves 3, Mets 1
ATLANTA -- Kris Medlen pitched seven strong innings to help Atlanta get another win at home.
Andrelton Simmons and Evan Gattis homered for the Braves, who have won 20 of 24 at Turner Field to improve the major leagues' best home record to 51-19.
Gattis, who was recalled earlier in the day after a three-game stint at Triple-A Gwinnett, tied it at 1 with his 16th homer in the seventh. After Mets starter Carlos Torres (3-3) walked Dan Uggla on nine pitches, Simmons hit his 13th homer to make it 3-1.
Medlen (12-12) allowed seven hits and one run while striking out nine. Closer Craig Kimbrel converted his 34th straight save opportunity and improved to 44 for 47 this season.
New York has dropped three straight and nine of 13.
Padres 3, Giants 2
SAN DIEGO -- Chris Denorfia hit a go-ahead RBI single in the seventh inning to lift the Padres to the victory.
Nick Hundley drew a leadoff walk in the seventh from rookie reliever Jake Dunning, who was called up earlier in the day from Triple-A Fresno.
Ronnie Cedeno followed with a single to send Hundley to third and bring on Javier Lopez.
Denorfia lined a 1-2 pitch to left for the single that broke a 2-all tie.
Dunning (0-2), who made his major league debut in June, took the loss. Tim Stauffer (3-1) got the win with 12/3 innings of shutout ball.
Huston Street pitched the ninth for his 26th save in 27 chances.
Marlins 6, Cubs 2
CHICAGO -- Donovan Solano had three hits, including a two-run double, and the Miami bullpen combined for 42/3 hitless innings.
Christian Yelich drove in three runs with a double and single for the Marlins, who have won three straight after losing six in a row.
Brian Bogusevic hit a solo homer for the Cubs, who dropped to 27-44 at Wrigley Field. Edwin Jackson (7-15) gave up three runs and seven hits in five innings.
Miami starter Tom Koehler pitched 41/3 innings, allowing two runs and four hits. He was pulled with bases loaded in the fifth, but was picked up by the Miami bullpen, which retired the next 11 batters. Ryan Webb (2-5) pitched two perfect innings for the win.
Blue Jays 10, Diamondbacks 4
PHOENIX -- Edwin Encarnacion, Rajai Davis, Adam Lind and Moises Sierra homered in Toronto's fifth win in six games.
The Blue Jays jumped out to a 5-0 lead against Wade Miley (9-10). Todd Redmond (3-2) allowed three runs and four hits in five innings for his second win in a row.
The Diamondbacks have lost three straight and five of six, all at home. Adam Eaton, Didi Gregorius and Miguel Montero went deep for Arizona.
Encarnacion also doubled, singled and walked twice. Going back to May 2010, he has homered in a record five straight games at Chase Field.
Miley didn't make it out of the second inning, allowing five runs and eight hits in 12/3 innings. Eaton had two throwing errors in left field, one of which led to an unearned run.