ST. PETERSBURG, Fla. (AP) — Joey Rickard had four hits and the Baltimore Orioles needed all of them to beat the Tampa Bay Rays.

None was bigger, however, than the last one.

Rickard drove in the winning run in the 11th inning with an RBI double, lifting the Orioles to a 6-5 victory Thursday night.

“This game is very hard and when something goes your way, it’s a relief,” Rickard said. “That moves you along a little bit.”

Rickard doubled off Diego Castillo (0-1) after two-out singles by Chris Davis and Rio Ruiz kept the inning alive for Baltimore.

After coming into the game on an 0 for 15 slide, Rickard reached base five times and drove in two runs against the team that drafted before losing him in the Rule 5 draft in 2015. He has 28 RBIs in 36 career games against the Rays.

“Oh man, it’s just a coincidence that it happened,” he said, “but it’s nice to get a good win.”

Rickard’s success against Tampa Bay wasn’t lost on Rays manager Kevin Cash.

“He seems to like playing at this ballpark or against his former organization,” Cash said.

Davis had entered the game as a defensive replacement in the ninth inning after missing the preceding two games with a stomach virus.

“He sparked us, obviously,” Orioles manager Brandon Hyde said. “I talked to him about some late-inning stuff and he was ready to go. He’s a pro.”

Former Mohawk Valley DiamondDawg John Means (2-2) got the win with four strikeouts in two hitless innings of relief for the Orioles, who broke a six-game losing streak against Tampa Bay.

The Rays lost for only the second time in 10 games.

Trey Mancini had three hits, and Pedro Severino homered for the Orioles.

Tommy Pham had four hits, included his third home run of the season for the Rays, but was picked off while trying to steal third base with the score tied in the ninth after Avisaíl Garcia homered off Mychal Givens.

Cobb’s return to the Orioles’ pitching rotation, Means goes to the bullpen. But Means (1-2, 1.98) will get another start sometime after Thursday’s off day. “Means is going to make a lot of starts,” Hyde said. “It’s something we’re going to play with because I do like John in the rotation. He’s pitching really well and deserves to stay in the rotation.”

The Orioles were rained out in the opener of a three-game series against Minnesota Friday and will play a doubleheader Saturday in Baltimore.