ST. PETERSBURG, Fla. — Will Harris walked himself into trouble before pitching his way out.

The Houston Astros reliever worked through a bases-loaded, no-out jam in the ninth inning, losing his club-record streak of 26 consecutive scoreless appearances before escaping with his third save in Saturday's 4-3 victory over the Tampa Bay Rays.

"My command was about as bad as it's been," the right-hander said after sandwiching two walks around a single to load the bases with no outs.

Steven Souza Jr.'s sacrifice fly trimmed Houston's lead to one run, but Harris held on by getting Desmond Jennings to hit into a game-ending double play.

"It's never a good feeling when you're releasing the ball and it's not going anywhere close to where you want it to go," said Harris, who hadn't allowed a run since his season debut April 7 against the New York Yankees, a stretch of 26 1/3 innings. "I was really struggling trying to figure out how to get the ball over the plate and let my defence work for me. Lucky for me it happened."

Carlos Gomez and Luis Valbuena hit solo home runs to back a strong outing for starter Mike Fiers (4-3), who allowed a pair of solo homers in seven innings and won for only the second time in a month.

Gomez went deep off Chris Archer (4-8) to tie it in the seventh. Marwin Gonzalez scored on Erasmo Ramirez's wild pitch in the eighth and Valbuena homered off Dana Eveland for a two-run lead in the ninth.

"With this team, all I want to do is keep it close and give us a chance of winning," Fiers said after arguably his best performance of the season. "It was big to keep my pitch count down and just keep us in the game."

Evan Longoria and Brad Miller homered for the Rays, who went 0 for 4 with runners in scoring position.

Archer entered Saturday with a streak of 15 2/3 consecutive scoreless innings against the Astros. He retired the first nine batters, striking out the side in the third inning, before George Springer and Gonzalez singled leading off the fourth. Jose Altuve followed with a sacrifice fly that erased a 1-0 deficit.

"My No. 1 goal the day that I pitch is get a team win. I threw the ball well, but not quite well enough," said Archer who yielded three runs and six hits over 7 2/3 innings.

Longoria's sixth homer in eight games snapped the tie and gave him 16 RBIs in his past 13 games. But both times the Rays gave Archer the lead, the Astros answered in the next half inning.

Gomez is just 2 for 15 on Houston's road trip, but both hits have been home runs. His first-pitch, two-out solo shot to straightaway centre made it 2-all in the seventh.

TRAINER'S ROOM

Astros: SS Carlos Correa (sprained left ankle) was out of the starting lineup for the second consecutive game. "He's progressing, he's sore," manager A.J. Hinch said.

Rays: RHP Brad Boxberger (left oblique) says he's progressing but has no definitive date for a potential return from a second stint on the 15-day disabled list.

POWER SURGE

One of Tampa Bay's top off-season priorities was to add more power to the lineup, and the addition of Miller, Steve Pearce, Logan Morrison and Corey Dickerson has added more thump. Longoria's homer off Fiers was his team-leading 15th, and the Rays are third in the majors in homers with 90 through 60 games. That's 35 more than they had at this point a year ago. Miller's homer was his sixth — first since May 14, a span of 83 at-bats.

THIN MARGIN

The Astros have played a major league-leading 39 games decided by two or fewer runs, including the past six. They are 19-20 in those games.

UP NEXT

Astros: 2015 AL Cy Young Award winner Dallas Keuchel (3-8, 5.44 ERA)) will look to beat Tampa Bay for the first time in Sunday's series finale. The left-hander is 0-3 with 4.78 ERA in five starts against the Rays.

Rays: LHP Matt Moore (2-4, 5.56 ERA), starts Sunday. He's allowed three earned runs over 12 innings in winning two previous starts against Houston.