Updated

Baltimore's Jason Hammel was pitching near his hometown and working on his ninth win, with a chance to improve his credentials in the voting for the final AL roster spot for next week's All-Star game.

Then came the seventh inning and his only two walks all night, followed by a hanging slider that Seattle's Casper Wells didn't miss.

"It was a close ballgame and every mistake matters, every pitch counts," Hammel said. "Walking those two guys in that inning ... those runners shouldn't have been there."

Wells hit a go-ahead, three-run double with two out and the Mariners beat the slumping Orioles 6-3 on Monday night, handing Baltimore its sixth loss in seven games.

Miguel Olivo and Dustin Ackley added back-to-back homers in the eighth off Troy Patton as the Mariners rallied for the win in their first game of the season against Baltimore.

Wells had a chance to drive home a run earlier in the game and failed. But he came up in the seventh and sent an 0-1 pitch from Hammel (8-4) into the gap in right-center. Ackley, Munenori Kawasaki and Ichiro Suzuki all scampered home to give Seattle a 4-3 lead.

Wells picked up his first RBIs since June 20 at Arizona and atoned for striking out with a runner on second in the third inning.

"He left the slider up a little and I was able to get it out there and I'm glad the guys were able to score," Wells said.

Hammel, who grew up on the Kitsap Peninsula, avoided major problems until his final inning.

Ackley started the seventh with a walk and stole second when Hammel struck out Chone Figgins on a 3-2 pitch. Ackley advanced to third on Kawasaki's single, but Brendan Ryan fouled out when catcher Matt Wieters made the catch at the edge of the top step of the Mariners' dugout. Suzuki walked to load the bases and Wells followed with a liner that cleared the bases.

But the Orioles might have avoided the big inning if second baseman Robert Andino had controlled Wieters' throw when Ackley stole second. Instead of a possible double play, the Mariners' rally continued.

"For me I should have caught that ball," said Andino, who appeared to sweep toward Ackley before fully securing the catch. "Probably the difference maker of the ballgame. We probably would have come out of that inning with the same score. But my fault, I take the blame for that."

The six runs were the most scored at home by the Mariners since June 16.

Chris Davis hit a three-run shot off Mariners starter Hisashi Iwakuma in the fourth, but that accounted for all of Baltimore's offense. After Davis' 14th homer, the Orioles got just three baserunners against Iwakuma, Steve Delabar (2-1), Shawn Kelley and Tom Wilhelmsen. Delabar worked two innings, striking out three. Kelley struck out a pair in the eighth and Wilhelmsen worked the ninth for his seventh save in eight chances.

"It's not woe is me and the sky is falling here," Orioles manager Buck Showalter said. "We'll get better. It's a tough fall. (Hammel) pitched great. He was outstanding, but we scored three runs with three hits and that's not going to do the job."

Iwakuma was making a spot start with Kevin Millwood still nursing a sore groin that has twice forced him to leave starts early in the past month. Iwakuma threw five innings, giving up just three hits. But he made the one critical mistake to Davis on a 1-0 pitch.

Davis has made a point of picking on Mariners pitching, first when he was with Texas and now Baltimore. Davis came into Monday night hitting .314 with six homers, seven doubles and 14 RBIs in 29 career games against Seattle. He also doubled in the second inning off the wall in left, missing a homer by just a couple of feet.

NOTES: The Mariners had three Japanese players in the starting lineup — Suzuki, Kawasaki and Iwakuma — for the first time in major league history. ... Seattle signed first-round draft pick C Mike Zunino. Zunino was taken with the No. 3 overall pick in June's amateur draft. He will be introduced at a news conference on Tuesday. ... Newly acquired Baltimore DH Jim Thome had his first hit with the O's in the fourth inning.