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 5 2-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.
The Tigers lost for the second time in six games despite the return of Cabrera, who missed three games with abdominal and groin problems. He went 0 for 4.
Scherzer rebounded from his worst start of the season and allowed two runs and five hits with eight strikeouts and three walks before leaving with runners at first and second and no outs in the eighth.
He struck out the side in the first, allowed a single in the second and then pitched two perfect innings.
He started the fifth by striking out Mike Carp before Jonny Gomes singled. Stephen Drew followed with a ground-rule double that went into Boston's bullpen in right-center field on one hop. After David Ross struck out, Middlebrooks put Boston ahead 2-1 with a single to center on a first-pitch slider.
''You may get one good pitch in an at-bat to hit (against Scherzer),'' Middlebrooks said. ''You can't miss it.''
The Tigers got base runners against Lester in four of the first six innings, but he worked out of three of those jams.
In the second, Omar Infante singled and reached third on a two-out single by Brayan Pena. Iglesias then lined a double that drove in Infante, but Pena was thrown out at home.
Lester retired the next seven batters, four on strikeouts, before Pena reached first on a fielding error by third baseman Middlebrooks with one out in the fifth. Iglesias struck out before singles by Austin Jackson and Hunter loaded the bases. But Lester retired Cabrera.
Detroit threatened again in the sixth when Prince Fielder singled and took second on a one-out single by Infante. But Lester struck out Matt Tuiasosopo for the third time and retired Pena on a fly out.
Scherzer ''pitched terrific. Early on I thought he was as sharp as he's been all year,'' Tigers manager Jim Leyland said. ''Tonight, Lester pitched better.''
NOTES: Boston starters have allowed three runs or fewer in 13 of its past 14 games. ... Detroit's Victor Martinez extended his hitting streak to 10 games with a single in the eighth. ... Red Sox CF Jacoby Ellsbury missed the game with a sore thumb. ... Rick Porcello (11-7) pitches for Detroit against Ryan Dempster (7-9) in the finale of the three-game series on Wednesday night.