SEATTLE — Ryan O’Hearn is just happy to be considered for the All-Star Game, whether or not he was voted to start it.

The Orioles slugger — a castoff from Kansas City who has revived his career with Baltimore — was banished to the Royals’ bench a few years ago and designated for assignment by them 18 months ago. It appeared O’Hearn would spend the rest of his baseball days as a fringe major leaguer before his ascendance with the Orioles last year that he’s maintained this season.

“It seemed unattainable for a long time,” O’Hearn said last week.

But if O’Hearn was angry about losing the fan vote to serve as the American League’s starting designated hitter at the Midsummer Classic, he sure made a point Wednesday.

O’Hearn bolstered his case to be an All-Star reserve in the Orioles’ 4-1 win over the Mariners, driving in three of Baltimore’s runs and going 2-for-3 at the plate. After losing the vote to the Houston Astros’ Yordan Alvarez earlier in the day, O’Hearn lined a two-run double in the third inning to give the Orioles an early lead and extended it with a solo shot in the fifth to back starting pitcher Dean Kremer.

“I’m just happy to have a good game and help the boys win,” O’Hearn said in the Orioles’ clubhouse after the victory. “This sounds cliche, but I’m locked in on the O’s winning the East right now. If I get to go to the All-Star Game, that would be a dream come true, it would be awesome. Either way, I’m just grateful for the love and the support that people voted for me. If it happens, it happens. If not, it’s all good; I’ll go home and enjoy my few days at home.”

In his first start since returning from the injured list, Kremer followed up Grayson Rodriguez’s 6 1/3 scoreless innings Tuesday with five clean frames of his own.

The right-hander missed six weeks with a triceps strain, but it didn’t look like it as he struck out eight batters and allowed only two hits and two walks. Kremer has been a key member of Baltimore’s rotation the past three seasons, and his return is a welcome sight for a starting corps that’s much weaker than when he left it in late May.

“I think when a guy’s coming off the IL, you just have no idea what to expect, honestly,” manager Brandon Hyde said. “For him to go on a big league mound on the road and pitch five scoreless innings, that was as sharp as he’s been really all year.”

Kremer threw only 83 pitches as he built up upon his return, but his bullpen mostly had him covered. Keegan Akin allowed a solo homer in the sixth to Cal Raleigh, who came feet away from tying Tuesday’s game with a mammoth blast in the ninth, for the Mariners’ first and only run so far this series. Jacob Webb, Cionel Pérez and Craig Kimbrel followed to throw 3 1/3 scoreless to slam the door.

Baltimore is 55-31 and extends its lead atop the American League East to a season-high two games over the New York Yankees, who lost Wednesday. The Orioles have won six of their past seven games, while the Yankees are 3-7 over their past 10 contests.

O’Hearn wasn’t the only Oriole to fall short of starting the All-Star Game to come through against Mariners starter Logan Gilbert, who entered with a 2.72 ERA and a 1.51 mark in June. After O’Hearn’s double in the third, Ryan Mountcastle smoked an RBI single to put Baltimore up 3-0. Mountcastle, who lost the vote at first base to Toronto Blue Jays slugger Vladimir Guerrero Jr., returned to the Orioles’ lineup after sitting the previous three games with an illness he described as feeling “not like myself.” But seeing himself up to start the All-Star Game, even if he was under the weather, was “awesome,” he said.

“Sort of keeping track of it and watching the votes, it was really cool to see,” he said. “Just to be even mentioned in something like that, definitely a cool thing for me.”

The Orioles knocked Gilbert out of the game in the sixth for the AL Cy Young contender’s second shortest start of the season. The heart of the Orioles’ order — from O’Hearn to Mountcastle to Anthony Santander, who also lost his fan vote in the outfield — put up consecutive quality at-bats to get to Gilbert in the third.

“When we’re short to the baseball and have a really middle-of-the-field, opposite-gap approach, we’re pretty dangerous,” Hyde said.

O’Hearn’s homer was his 11th of the season — one of seven Orioles in double figures — and boosted his season average to a team-best .294 and his OPS to .840, second to only All-Star starter Gunnar Henderson.

“He’s been doing this all year for us: hits after hits in big spots,” Hyde said. “Where we’d be without him — he’s been unbelievable for us.”

As his offense built a lead, Kremer mixed his five pitches, mainly his four-seamer, cutter and splitter, to keep Seattle (47-41) off-balanced. He did not allow a hit until two outs in the fourth against the Mariners, who have lost 10 of their last 13 and have one of the worst offenses in the majors, ranking last in batting average at .216.