Tampa Bay’s Elliot Johnson slides safely into home plate on a double by Ben Zobrist as Baltimore catcher Matt Wieters fields the throw. (Gail Burton/Associated Press)

The Baltimore Orioles had their first chance to earn a three-game sweep of the Tampa Bay Rays at Camden Yards since 2007, and they could have gone up three games on Tampa Bay — which would have been monumental considering the Rays came to Baltimore on Friday tied with the O’s atop the American League East standings.

Despite getting their shortest outing of the season from one of their starting pitchers Sunday, the Orioles still had a shot to sweep the Rays out of Baltimore.

Their 9-8 loss to Tampa Bay — which ended with the winning run on second base — ended this series in bittersweet fashion.

Opening day starter Jake Arrieta lasted just 32 / 3 innings for his worst start of the season, but the Orioles bullpen again kept them in the game.

Arrieta allowed a career-high 10 hits and seven runs (seven earned) with two walks and six strikeouts. It was Arrieta’s shortest outing in nearly a year, since he lasted just 21 / 3 innings against Seattle on May 30.

Since throwing eight scoreless innings at Yankee Stadium 12 days ago, Arrieta has allowed 13 earned runs over 10 innings in two starts.

Despite the loss, the Orioles still ended the three-game series with a one-game lead over Tampa Bay atop the AL East standings

The Rays went up 3-0 in the second inning on No. 9 hitter Elliot Johnson’s run-scoring single, followed by a two-run double by Ben Zobrist.

Baltimore answered in the bottom half of the inning on Chris Davis’s infield single, which scored catcher Matt Wieters, who led off the inning with a double.

Tampa Bay added one run in the third on a single by Will Rhymes, then tacked on three more in the fourth, sending seven batters to the plate and chasing Arrieta from the game.

After singles by Johnson and Zobrist to open the inning, Matt Joyce drove in one run with a single and Carlos Pena lined a two-run double — his second double of the game against Arrieta — to make it 7-1.

Back-to-back doubles by J.J. Hardy and Nick Markakis in the sixth made the game 7-2 and set the tone for Wieters’s two-out, two-run homer off Rays starter James Shields that cut the lead to three.

Shields was one strike away from ending the inning before Wieters took a 3-2 fastball over the right-center-field fence for his eighth homer of the season and the Orioles’ major league-leading 61st of the season.

Nick Markakis made it a one-run game with a two-out double to the warning track in center field that went off the glove of B.J. Upton in the seventh.

— Baltimore Sun