ST. LOUIS – Marcell Ozuna made Homer Bailey work. Then he made him pay.

Ozuna and Matt Carpenter went deep as part of a four-homer barrage and the St. Louis Cardinals split a doubleheader with the Kansas City Royals by winning the second game 10-3 on Wednesday night.

Brad Keller threw seven-plus innings of two-hit ball to snap a six-start winless streak and Jorge Soler hit a three-run homer as the Royals beat the Cardinals 8-2 in the first game.

Severe storms around St. Louis forced Tuesday night's game to be postponed and created the day-night twinbill.

Ozuna capped a 12-pitch at-bat by blasting a three-run homer off Bailey over the right field wall to give the Cardinals a 3-0 lead in the first. Carpenter set the tone against Bailey, who threw 42 pitches in the inning, with a nine-pitch walk.

"Just be ready and working hard and right now try not to do too much," Ozuna said. "I'm just trying to put the ball in play and make contact because that last two series I've struck out a lot."

Ozuna also doubled, walked and scored twice. He drove in the Cardinals' only runs in the first game, giving him five RBIs on the day.

"It's more of a momentum game than maybe people realize," Cardinals manager Mike Shildt said. "We kept it going, finished out, which says something about the group. Finished out the first game, kept playing. And that's a good sign when you keep playing the game when it's not going your way. Good things will happen. Ozuna picked right up."

Dexter Fowler and Kolten Wong also homered as St. Louis had as many home runs in the second game as it did hits in the opener.

Getting the early lead was a jolt of positive energy for the Cardinals, who had lost 10 of their last 12 games entering the second game.

"After we lost that game before, we got an early shot and we put some (runs) on the board," Ozuna said. "That's pretty impressive."

Adam Wainwright (4-4) battled through control issues with 55 of his 103 pitches going for strikes. In five innings, he allowed three runs, six hits, walked four and struck out two.

"We had a 5-0 lead and I needed to go at least seven today to help this team out, help this bullpen, and I didn't go that way so I'm a little disappointed," Wainwright said.

John Gant, Andrew Miller, Carlos Martínez and John Brebbia combined for four scoreless innings of relief.

Carpenter's two-run homer in the second inning landed in the right field bullpen. Fowler added a solo homer in the sixth as part of a three-hit night. Wong's three-run homer capped a four-run seventh.

Bailey (4-5) threw 66 pitches, but lasted just 1 2/3 innings and gave up five runs. The right-hander has allowed 10 earned runs in his last two starts (six innings) and he hasn't beaten St. Louis since 2014 (eight starts).

"They kept fouling pitches off, fouling pitches off," Royals manager Ned Yost said. "Ozuna I think had a 12-pitch at-bat. In that (first) inning I thought his stuff was pretty good, but the pitch count jumped up so quick, 42 pitches in the first inning. It just jumped up to the 65 mark after five outs. Just a lot of pitches."

Hunter Dozier's 10th home run of the year off of Wainwright in the fifth inning traveled 420 feet. Adalberto Mondesi had a pair of hits, scored and drove in a run.

• In the first game, Keller snapped out of his slump.

Keller threw seven-plus innings of two-hit baseball, Jorge Soler hit a three-run homer in the Royals’ 8-2 win.

Keller (3-5) ended his six-start winless streak. He worked around leadoff walks in the first, second and fourth innings and had retired 12 of 13 batters before Matt Carpenter walked and Paul Goldschmidt singled to start the eighth, ending Keller's day.

"Definitely felt a lot better," said Keller, who had given up 17 earned runs in his previous five starts covering 27 1/3 innings. "More comfortable in my delivery, especially in innings three to seven. I was able to get ahead of those guys and just go after them."

Keller matched his longest outing of the season. He struck out three, walked four and hit two batters.

Control was Keller's biggest issue during his struggles as he walked 20 batters in his previous five starts. Though he gave up four free passes to St. Louis, the lack of contact helped him.

"Didn't allow any of that to kind of fester into trouble for him, just came back and made good pitches after that," Royals manager Ned Yost said. "Really did a good job of managing his pitch count. Really had good stuff, had the good two-seamer, had everything working for him today."

Kevin McCarthy relieved Keller and gave up a two-run double to Marcell Ozuna. The Cardinals finished with four hits, two by Matt Wieters.

Soler's drive into the left field seats off Michael Wacha (3-2) capped a six-run third and made it 7-0.

"Any time you get runs support like that you basically just go out there and say, 'here it is,' and just try to get as deep into the game as possible," Keller said.

Wacha has allowed 18 earned runs and 30 hits in 25 1/3 innings in five starts since returning from the injured list with left knee patellar tendinitis.

"The way I've been pitching, it's unacceptable," Wacha said. "It's tough. You've got to be able to pitch well to stay in this league and right now I have not been pitching well. I have to do a better job."

Whit Merrifield had two hits, drove in a run and scored once. Mondesi had two hits, drove in two and scored. Nicky Lopez reached three times and scored twice and Dozier hit a pair of sacrifice flies.

Roster moves

Royals: RHP Kevin McCarthy was recalled from Triple-A Omaha after RHP Heath Fillmyer was optioned on Sunday.

Cardinals: RHP Luke Gregerson cleared waivers and was given his unconditional release, making him a free agent.

Up next

Royals: RHP Jakob Junis (3-5, 5.69 ERA) kicks off a three-game series against the New York Yankees, who have not named a starter, on Friday night. Junis has lost his last three starts.

Cardinals: RHP Miles Mikolas (4-4, 4.88 ERA) will look to bounce back in the opener of a three-game set against the Atlanta Braves and RHP Mike Foltynewicz (0-3, 6.91 ERA). Miles gave up seven runs in a career-low 1 1/3 innings in his last start at Texas last Friday.