O’s starter Wei-Yin Chen gave up five runs in the first inning but still got the win. (Leon Halip/GETTY IMAGES)

After one inning of baseball at Comerica Park on Sunday afternoon, it looked like the Baltimore Orioles were in for a long day.

Yet these Orioles wrote their most recent chapter of resiliency against the Detroit Tigers, coming back from a five-run deficit to win, taking a pivotal road series in Detroit with a 7-5 victory.

The win handed the Tigers their first home series loss in more than two months — they lost two of three to Cleveland at Comerica on June 5-7 — after winning 18 of 20 at home.

“There’s a lot of trouble lurking in that lineup,” Manager Buck Showalter said of Detroit. “And I’m glad they’re somebody else’s problem now.”

The Orioles (66-55) remained in one of the two American League wild-card positions while sending the Tigers (64-57) two games back in the race.

“We are confident,” said J.J. Hardy, who hit a two-run double in the Orioles’ four-run second inning. “Obviously we feel like we can win every game. We didn’t know we were going to score more than five, but we knew we could. It wasn’t like we were thinking the game was over in the first inning.”

It didn’t start well for the Orioles. Six of the first seven batters against Baltimore starter Wei-Yin Chen reached base, putting the Orioles in a 5-0 hole.

In that 41-pitch inning, Chen yielded a solo homer to Omar Infante and a three-run shot to Jhonny Peralta.

But the Orioles rallied with seven unanswered runs off Tigers starter Doug Fister.

Chris Davis’s solo homer to open up the second inning opened the gates to a four-run second inning.

He became the first Oriole to hit homers in back-to-back games in Detroit since Miguel Tejada in 2004.

Nick Markakis added an RBI double and Hardy hit his two-run double, both hits coming with two outs, to make the score 5-4.

In the fourth, Nate McLouth’s two-out triple gave Baltimore a 6-5 lead, followed by Adam Jones’s looping single to right that plated McLouth.

Chen, who allowed just two hits after the first inning, lasted five innings and became the second first-year Orioles pitcher to win 12 games in club history, joining Daniel Cabrera in 2004.

“This is baseball,” Chen said through interpreter Tim Lin. “You never know what’s going to happen. You never give up, you just keep fighting.”

The Orioles bullpen, which had pitched to a 1.56 ERA, threw four scoreless innings in relief, capped by Jim Johnson’s 37th save, which tied Gregg Olson for the second-highest single-season total in club history.

— Baltimore Sun