CLEVELAND — Carlos Carrasco wasn’t about to let a bug in his eye get in the way of winning a game.

Carrasco overcame the bug — followed by a home run one batter later — and the Cleveland Indians defeated the Houston Astros 6-5 on Wednesday night.

The game-time temperature was 87 degrees, causing swarms of midges to journey from Lake Erie to the muggy ballpark. A bug flew into Carrasco’s left eye as he threw a pitch to Yuli Gurriel in the fourth inning.

“That was weird,” he said. “I tried to throw a curveball and maybe threw it 20 feet.”

Carrasco bent over and a trainer made a brief visit to the mound. Gurriel singled on the next pitch and Colby Rasmus hit the first pitch into the seats in right field, giving Houston a 3-2 lead.

“It doesn’t feel good,” Carrasco said of the bug attack. “That’s the first time this has happened to me but I had to come back and get people out.”

Carrasco (11-7) regrouped after the homer, allowing four runs in 7 1/3 innings.

Players in the field and batter’s box spent the night slapping away the bugs.

“They were everywhere,” Indians manager Terry Francona said. “In the dugout it’s hard to sense it but when you get on the field, man, they were all over the place.”

Mike Napoli’s two-run homer off Doug Fister (12-11) gave Cleveland a 4-3 lead in the fifth. Pinch-hitter Brandon Guyer added a two-run double in the inning and the Indians extended their lead over Detroit to 5 1/2 games in the AL Central.

Cody Allen gave up a leadoff single in the ninth, but struck out the next three batters, including Jose Altuve — the AL’s leading hitter — to earn his 25th save.

“Those are situations you don’t like them all the time but in hindsight you enjoy them,” Allen said. “It’s competition at its best — game on the line. He’s one of the best hitters in the game.”

The loss cost Houston a chance to gain ground in the AL wild card race. The Astros still trail Baltimore by two games.

Houston still led by a run when Francisco Lindor singled to start the fifth. Napoli hit his 31st homer — a 433-foot blast three-quarters of the way up the bleachers in left field.

Guyer, batting for Tyler Naquin, doubled in two more runs off Kevin Chapman.

“The whole fifth inning was a problem for us,” Astros manager A.J. Hinch said. “We needed some guys to get some outs, but I didn’t have a lot of guys available (out of the bullpen).”

Gurriel hit his first major league home run — a two-run blast off Andrew Miller in the eighth.

Lindor was 3 for 4 for his 23rd three-hit game, a major league high. Lonnie Chisenhall had three hits and an RBI for Cleveland.

FIFTH SPOT UPDATE

Mike Clevinger will start for the Indians in Minnesota on Saturday. He allowed a run in 1 2/3 innings, throwing 43 pitches, and took the loss Monday against the Astros, a game in which Cleveland used eight pitchers. Josh Tomlin, removed from the rotation last week, will also be available.

TRAINER’S ROOM

Astros: SS Carlos Correa was sent back to Houston because of inflammation in his left shoulder.

Indians: C Yan Gomes (separated right shoulder) caught five innings for Triple-A Columbus on Wednesday, his first time behind the plate since being injured July 17.

UP NEXT

Astros: RHP David Paulino, one of Houston’s top prospects, makes his big league debut Thursday. He went 5-4 with a 2.00 ERA at three minor league levels covering 20 outings.

Indians: RHP Trevor Bauer tossed seven scoreless innings in a May 10 victory at Minute Maid Park. He is 4-0 with a 0.67 ERA in four career starts against the Astros.