NEW YORK (AP) — Even with a loss, the Baltimore Orioles achieved another goal.

While the Orioles were getting one-hit for the third time in seven weeks during a 5-0 loss to the New York Yankees on Monday night, Baltimore clinched home-field advantage in the AL division series when Detroit lost to the Chicago White Sox. The Orioles open the postseason at Camden Yards against the AL Central champion or the wild-card playoff winner starting Oct. 2.

"It wasn't a foregone conclusion. So now there is only one thing left to do," Orioles manager Buck Showalter said, thinking about the possibility of overtaking the Los Angeles Angels for best record in the AL and home-field advantage throughout the postseason.

Los Angeles (96-61) leads the Orioles (93-63) by 2½ games, and Baltimore holds the tiebreaker because it beat the Angels 4-2 in the season series.

"It's going to be really hard to obtain, to catch the Angels," Showalter said.

Michael Pineda retired his first 13 batters before J.J. Hardy singled sharply to left field, pitching 7 1-3 innings and combining with three relievers on a one-hitter. Derek Jeter began his final series at Yankee Stadium with his first three-RBI game in two years, putting the Yankees ahead 4-0 with a two-run double in the fifth off Wei-Yin Chen (16-5).

"I thought my control wasn't good tonight," Chen said through a translator. "Even if we had not clinched the playoffs yet, I still wanted to treat this like a normal game. I wanted to stay focused. I still wanted to pitch a good game."

Chen, the Orioles' winningest left-hander since Jeff Ballard went 18-8 in 1989, gave up four runs and six hits in six innings. He had been 4-0 in seven starts since losing at Toronto on Aug. 6.

Part of the trouble might have been caused by pitching on six days' rest rather than the usual four.

"I thought he had trouble locating his breaking ball. It's something that happens when you're not on your regular rest," Showalter said.

Pineda (4-5) struck out eight, walked one and lowered his ERA to 1.93. He got some rare offensive support from the Yankees, who had scored 19 runs in his previous 15 big league starts, and was given defensive help by second baseman Stephen Drew, who made a diving stop on Alejandro De Aza's first-inning grounder.

"He's good. His ball cuts. He's got a great slider. It's really tough to pick him up," Hardy said. "He didn't leave much over the plate tonight. He threw strikes, but they were pitcher's strikes."

Shawn Kelley, Rich Hill and David Phelps finished.

Jose Pirela, the Yankees' team-record 57th player this season, became New York's first player in 33 years to triple in his first big league at-bat, going 2 for 3 with the go-ahead RBI. Chase Headley added a solo homer into Monument Park in the eighth off Ryan Webb.

Baltimore is 2-3 since clinching the AL East but has five more tuneup games before its second division series appearance since 1997. October baseball will be different than these regular-season games.

"I think everybody is tired in September," Hardy said.

More From 104.5 THE TEAM