The much-improved Kansas City Royals bullpen had in a lot of ways been the heartbeat of the club this season. On Wednesday night it was the source of heartache as the game and the series flipped on the Royals abruptly in the ninth inning.


The Royals went into the final inning with a three-run lead in the rubber match of the three-game series with the only bullpen in the majors without a blown save this season.


However, they were forced to turn to closer Trevor Rosenthal for the final two outs in the eighth and the St. Louis Cardinals sent nine men to the plate, drew four walks, one hit by pitch and came up with two hits to pull off the rally.


Royals left-handed reliever Randy Rosario walked in the winning run as the Royals lost 6-5 to their I-70 rivals at Busch Stadium on Wednesday night in the first game of the second half of the pandemic-shortened 60-game season.


"Our bullpen has been really good for us all year," Royals outfielder Whit Merrifield said. "These games, they happen to everybody. Throughout the course of the year, they happen. We've been fortunate that when we've had a lead late in the game, it hasn't. We've ended up winning most of those games."


The Royals (12-19) lost for the first time this season when leading after the eighth inning. They'd been 9-0 in such scenarios. They're also now 7-11 in games decided by two runs or fewer.


The Royals will have Thursday off, and they'll start a stretch of 17 consecutive games on Friday in Chicago.


"We have the off day to forget about it, then we have 17 in a row," Merrifield said. "I don't know the schedule by heart, but I think the majority of that is in division. So we've got a chance to make up some ground even though we're not in a spot we want to be in."


First baseman/outfielder Ryan McBroom became the first player in the majors this season with two pinch-hit home runs. His no-doubt-about-it blast in the eighth inning broke a tie and gave the Royals a one-run lead, 3-2.


Merrifield, who went 3 for 5 with two doubles, drove in a pair of runs in the top of the ninth on a two-run double to left-center field that Cardinals left fielder Tyler O'Neill overran. The Royals led 5-2 going into the bottom of the ninth.


Rosenthal, who recorded his seventh save in seven tries on Tuesday night, recorded back-to-back strikeouts with the bases loaded to preserve a one-run lead in the eighth inning after Josh Staumont ran into trouble. Rosenthal came back out in the ninth.


"We talked to him in the eighth, and we really didn't have anyone else who could get us out of that mess," Royals manager Mike Matheny said. "So we told him ahead of time, 'We're not going to make you try and get five outs here. What we need you to do is use up your pitches, give us a chance, what you got. You and I will be in communication.'


"That was a pretty impressive thing to watch, how he got through that eighth and bailed us out of a really tough situation."


Matheny said he decided to go hitter-by-hitter in the ninth, but he had a pitch count in mind and that's when he visited the mound to talk with Rosenthal. Ultimately, Matheny said they got to a pitch number that "just didn't feel safe anymore."


"I'm not going to sacrifice a player's health," Matheny said. "We chase these things at all costs, except that one."


Rosenthal threw a season-high 34 pitches, and tied a career-high with four strikeouts. He also sandwiched a pair of walks around a double by Brad Miller. Rosenthal left with the bases loaded, two outs and former teammate Yadier Molina coming to the plate.


"Tough spot to come in," Matheny said of Rosario. "That was not an easy assignment we gave him, but I know he wants the ball in any situation. Unfortunately, that one didn't work out."


Rosario, the seventh Royals reliever of the night, hit Molina on a 2-2 pitch to force in a run. O'Neill atoned for his misplay in the outfield with a sharply-hit drive that short-hopped Royals third baseman Maikel Franco and deflected off Franco into shallow left field as two runs scored to tie the game with two outs.


Kolten Wong drew a walk on five pitches to force in the winning run.


Royals pitchers managed to strand 14 Cardinals runners on base in the game.


Cam Gallagher and McBroom hit home runs for the Royals in the loss, and Nicky Lopez scored twice.