ST. PETERSBURG, Fla. (AP) -- Chris Davis hit his fifth career grand slam and Miguel Gonzalez took a shutout into the eighth inning as the Baltimore Orioles snapped a four-game losing streak with a 5-1 victory over the Tampa Bay Rays on Saturday night.

Gonzalez (9-6) allowed one run and five hits over 7 2-3 innings to win for the third time in his last four starts. The right-hander didn't issue a walk and struck out five.

Davis hit his 22nd homer of the season after J.J. Hardy, Jonathan Schoop and David Lough singled to load the bases against Erasmo Ramirez (8-4) in the third inning.

More from FoxSports

The Orioles added a run in the eighth when Lough tripled down the right field line and bounced up from his slide to jog home and score on second baseman Logan Forsythe's throwing error.

The five runs are the most Ramirez has allowed in two months, a span of 10 starts in which he's gone 6-2 with two no-decisions. He entered Saturday night with a streak of nine consecutive appearances allowing two or fewer runs, tied for the second-longest stretch in Rays' history.

Gonzalez, meanwhile, improved to 2-1 in four starts against Tampa Bay this season, limiting the light-hitting Rays to three runs in 29 innings. He allowed doubles to Evan Longoria and singles to Kevin Kiermaier and James Loney through six innings, but Tampa Bay went 0 for 3 with runners in scoring position.

The Rays avoided being shut out for a 10th time when Curt Casali homered off Gonzalez with one out in the eighth.

Ramirez allowed five runs and seven hits over 7 1-3 innings.

Chaz Roe finished the combined five-hitter for the Orioles, retiring all four batters he faced after replacing Gonzalez.

TRAINER'S ROOM

Orioles: RHP Jason Garcia (right shoulder) has allowed three runs, six hits and eight walks and struck out nine over nine innings in his first five minor league rehab games with Double-A Bowie.

Rays: LHP Drew Smyly (torn labrum) will start a minor league rehab assignment Sunday with Triple-A Durham. The key acquisition from Detroit in the three-team trade that sent David Price from Tampa Bay to the Tigers last summer hasn't pitched since May 5.

UP NEXT

Orioles: LHP Wei-Yin Chen (4-6) makes his fourth start this season against the Rays in Sunday's series finale. He went 0-1 with a 4.15 ERA in the first three.

Rays: LHP Matt Moore (1-1) will make his fifth start Sunday since returning from elbow surgery. He hasn't gone more than five innings in his first four outings.