BALTIMORE — As Salvador Perez strode to the plate in the sixth inning on Wednesday, at least three things were true. The Royals’ offense was in an instafunk, mired in a three-day slump that took root here on Monday. The club had put two runners in scoring position with nobody out after Eric Hosmer ripped a double to right. And Perez had dug in the box twice against Orioles starter Jeremy Hellickson and swung at the first pitch both times.


Even in the moment, the feeling was obvious: This was a pivotal hitter. The deficit was three runs. The Royals’ offense was finally stirring. Perez was one swing away from tying a baseball game at Camden Yards.


In a 6-0 loss to the Orioles, Perez would take one swing, a hack that defied logic and reason. Hellickson spun a 77 mph curveball toward the plate. Perez hit a weak pop-up back to the mound.


In three pitches, Perez had produced three outs and hit just one baseball past the pitcher. In moments, the Royals would squander a scoring opportunity in rather frustrating fashion. Mike Moustakas followed by striking out swinging. Jorge Bonifacio ended the sixth inning with a soft grounder to first base.


A nine-game road trip that began with five wins in six games ended with three straight losses in Baltimore. An offense that powered sterling months in June and July would run out of gas, producing just three total runs in three games.


The Royals (55-51) were swept for the first time since losing three straight at Dodger Stadium during July 7-9. They have lost seven straight at Camden Yards and scored just five runs in six games here in the last two seasons.


The numbers tell just part of the story: On Monday, the Orioles’ starting rotation entered the series with a 5.83 ERA, the worst in the American League. The Royals had no answer for the trifecta of Ubaldo Jimenez, Dylan Bundy and Hellickson, a right-hander making his first start since being acquired from Philadelphia in a predeadline trade.


In the moment, the strategy behind the deal verged on perplexing. The Orioles (53-54) were under .500 and stuck in no-man’s land as the deadline approached. They appeared more likely to sell rather than buy. Yet, in three days, they picked up three games on the Royals, who remained in the second American League wild card spot, a half game ahead of the Tampa Bay Rays.


Tonight, Kansas City will open a four-game series against the Seattle Mariners at Kauffman Stadium. The Royals will begin the day just 2 1/2 games behind first-place Cleveland after a rainout postponed a game in Boston.


As the Royals’ offense languished, starter Jason Vargas was nicked for three runs in five innings, the damage coming on a three-hit sequence in the second inning.


Designated hitter Trey Mancini singled. Shortstop Tim Beckham lined a double to right field. And Caleb Joseph clubbed a two-run homer into the seats in left. Nearly 10 minutes later, a rainstorm hit downtown Baltimore, forcing a 35-minute delay during the top of the third.


Vargas would return to the mound, offering 96 pitches in five innings as his left arm weathered the break. The performance saved the bullpen and kept the Royals within striking distance until the eighth.


At that point, Baltimore put the game away with three runs against reliever Brandon Maurer.


Hours earlier, the clubhouse appeared quiet and still as the Royals prepared to close out a three-city road trip. Eric Hosmer sat a computer and watched video of Hellickson before heading to an indoor cage. Danny Duffy lounged on a leather couch and looked at his phone. A few feet away, Whit Merrifield laid on another couch.


The Royals had started the trip by sweeping the Tigers and taking two of three from the Red Sox in Boston. By Wednesday, however, they were starting to suffer from a bit of road fatigue.


Center fielder Lorenzo Cain received a day off to rest a gimpy hamstring. Moustakas spent an evening at designated hitter as his right leg remained sore after being plunked in Detroit last week.


The offense was not at full strength. The result was a lost series at Camden Yards. By the final moments of the ninth inning, Moustakas and manager Ned Yost were tossed by home-plate umpire John Tumpane.