With their confidence sagging, they had to end a season-high losing streak if it meant battling, scratching or clawing their way to a win.

They did all of that.

Roberto Perez's crawling infield single scored Francisco Lindor with the go-ahead run with two outs in the eighth inning as the Cleveland snapped a four-game losing streak with a 3-1 win over the Tampa Bay Rays on Friday night.

"It was big," said starter Shane Bieber, who matched Cy Young winner Blake Snell for five innings. "It was just a really good game, a really tough game and just to be able to come out on top I think is gonna prove big for us going down the stretch."

With the bases loaded, Perez, who returned to the lineup after missing two games with a concussion, hit a slow roller off Jose Alvarado (0-4) that third baseman Daniel Robertson charged but couldn't field with his bare hand.

Alvarado then walked Jake Bauers to force in Carlos Santana, giving the Indians a 3-1 lead. Alvarado, who replaced Snell in the seventh, walked three in the eighth.

"I thought I was throwing the ball good," Alvarado said. "Sometimes in this game, it's not going to go your way. I thought I threw a good pitch on ball three to Bauers, but I didn't get it. Sometimes, things go your way. Sometimes, they don't."

A.J. Cole (2-1) struck out the side in the eighth and Brad Hand worked the ninth for his 13th save in 13 tries.

Jordan Luplow homered in the fourth off Snell for the Indians, who have been in an offensive funk for months and have been searching for something - or someone - to get them going.

In the fourth, Luplow drove a high fastball out of the strike zone from Snell over the wall in right-center.

"I had no business swinging at that pitch, I'm going to be honest," Luplow said. "I was just trying to be aggressive. Because when you get to two strikes with a guy like that, it's going to be a real tough at-bat. Luckily I got a hold of one."

Other than allowing Luplow's homer, Snell had little trouble with the punchless Indians, who came in batting .222.

The left-hander gave up just four hits in 6 2/3 innings. He had issues with his command while walking three, striking out seven and throwing a season-high 104 pitches before manager Kevin Cash gave the ball to Alvarado.

"I was frustrated with a few walks and some outcomes, but for the most part, I thought I did OK," Snell said. "I was upset with how I started and how I finished."

BATTLING BIEBER

Bieber, who fanned 15 in a complete-game shutout against Baltimore on Sunday, worked his way out of one-out, two-on jams in three innings. But he threw too many pitches - 111.

"They made Bieber work so hard and fortunately for us he was up to it," Francona said. "Every inning, every at-bat, he even said to me, `Man, their at-bats. They didn't chase.' But he also hung in there. I thought he really battled."

LINEUP CHANGE?

Francona has considered moving Lindor out of the leadoff spot to shake up his club's lethargic lineup. He's also spoken to the All-Star about it.

For now, nothing will change.

"He said, `I'll hit wherever you want me to,'" Francona said. "I think there has to be a reason that makes you better and I don't know if I could say that that would make us better. He's a great player. But then who's leading off?

"We're probably taking maybe the best leadoff hitter in baseball, man that's a pretty good thing to have. We have to find a way to lengthen our lineup. I think it's going to be more with our guys' approach and the guys we have just picking it up a little bit."

WALK ON THE WILD SIDE

Santana has drawn a walk in a career-high 10 games, the majors' longest streak. It's the longest run by a Cleveland player since Victor Martinez walked in 10 straight in 2006.

TRAINER'S ROOM

Rays: 3B Robertson (allergic reaction) didn't start after leaving Thursday's game early. He has a nut allergy and ate sweet potatoes containing pecan. "By the second inning, his color and skin tone changed," manager Kevin Cash said. "We've seen it before, but not like this."

Indians: RHP Mike Clevinger threw a 35-pitch bullpen session and will now head to the team's year-round training complex in Arizona to continue to rehab from an upper back strain. Clevinger's quick recovery has been a huge plus for the Indians, who feared he might be out several more months.

UP NEXT

Rays: RHP Charlie Morton (4-0, 2.65 ERA) has a 17-start unbeaten streak, going 7-0 with a 3.21 ERA since last August 17.

Indians: RHP Carlos Carrasco (4-4, 4.30 ERA) lost both starts against Tampa Bay last season. He leads the AL in strikeout-to-walk ratio (7.33).