ST. PETERSBURG, Fla. — Ubaldo Jimenez appeared headed toward an early shower just two outs into Monday’s game.

Then, suddenly, the Baltimore right-hander became almost unhittable.

Jimenez threw a two-hitter for his first complete game since 2011, Chris Davis homered and drove in three runs and the playoff-contending Orioles beat the Tampa Bay Rays 7-3.

“He kind of got rolling there,” Baltimore manager Buck Showalter said. “That was fun.”

The Orioles moved within two games of AL East-leading Toronto, which lost 5-3 to the New York Yankees.

Jimenez (6-11) struck out six and walked one. He retired 25 of 26 — the lone baserunner coming on a fourth-inning walk — after giving up Logan Morrison’s three-run homer in the first.

“It wasn’t easy,” Jimenez said after his ninth career complete game. “It’s never easy to get people out. The sinker was great, especially after the first inning. I was able to get it down.”

Jimenez’s complete game was Baltimore’s since Sept. 3, 2014, when Miguel Gonzalez went the distance against Cincinnati.

“There’s no reason that he shoots a complete game against us today,” Morrison said. “I didn’t think he was that good. He was good, but he wasn’t that good. I think we got ourselves out a lot.”

Davis hit his 34th homer, a solo shot off Matt Andriese, during a two-run fourth. Davis drove in two with a single in a five-run fifth that made it 7-3.

Rays slugger Evan Longoria left with soreness in his right hand. He was hit by a pitch in the first but remained in the game until being pulled after the fifth inning. The Rays said X-rays on Longoria’s hand were negative.

“The best news of the day was negative (X-rays),” Rays manager Kevin Cash said. “Frustrating, disappointing loss.”

Andriese (6-7) lost his seventh straight decision, allowing seven runs and nine hits in five innings.

Mark Trumbo had an RBI single and Jonathan Schoop, mired in an 0-for-15 slide, had a two-run single during the fifth.

TRAINER’S ROOM

Orioles: LHP Brian Duensing (left elbow) was reinstated from the 60-day disabled list and RHP Odrisamer Despaigne was designated for assignment. … RHP Chris Tillman (right shoulder) will throw off a mound Wednesday and could return this weekend. . RHP Darren O’Day (right shoulder) will also have a throwing session Wednesday.

Rays: SS Matt Duffy, who missed two months this season with a left Achilles’ tendon strain, had a scheduled day off but replaced the injured Longoria at third. … 2B Logan Forsythe also was rested.

BENCH MARKS

Brad Miller, shifted from shortstop to first base after Duffy was acquired from San Francisco last month, started at short due in part to the Rays having just a three-man bench. Tampa Bay recalled RHP Chase Whitley from Double-A Montgomery after the game. RHP Steve Geltz, utilityman Richie Shaffer and OF Mikie Mahtook will be recalled, and LHP Justin Marks will have his contract purchased from Triple-A Durham Tuesday. C Hank Conger was designated for assignment.

UP NEXT

Rays RHP Jake Odorizzi (9-5), who has a 1.89 ERA since the All-Star break, will go against Orioles RHP Yovani Gallardo (4-7) on Tuesday night.