PITTSBURGH — Tyler O’Neill hit a two-run double to end a no-hit bid started by Pittsburgh’s Mitch Keller, and the St. Louis Cardinals rallied to beat the Pirates 5-4 Saturday night.

Keller threw 84 pitches over six no-hit innings and was pulled from the game leading 4-0, but the Cardinals scored five runs off relief pitchers Geoff Hartlieb and Sam Howard in the seventh. O’Neill broke up the no-hit bid and keyed the inning with his bases-loaded double against Howard (2-3).

St. Louis improved to 25-24 and is a game ahead of Cincinnati and Milwaukee for second place in the NL Central. The top two teams in each division advance to the expanded postseason.

“Tonight was a microcosm of this group,” Cardinals manager Mike Shildt said. “Down 4-0, getting no-hit after six innings, it’s not the most ideal conditions, but this group thrives when there aren’t ideal conditions.”

The 24-year-old Keller spun a gem in his second start since missing six weeks with a strained left oblique but was pulled well short of finishing it off. He walked two and hit O’Neill with a pitch before retiring his final 14 batters, finishing with six strikeouts.

Keller knew his chances of going nine innings were slim.

“I was thinking just go out there and get quick outs and go as deep as I can,” he said. “I knew I had a no-hitter from the first batter. I had a few walks, but other than that, I was pretty pleased.”

Hartlieb relieved in the seventh and promptly loaded the bases by walking Brad Miller and Paul DeJong and drilling Yadier Molina. Howard then came in and allowed O’Neill’s line drive into the left field corner.

“I felt I had to do the job there and put the ball in play hard somewhere,” O’Neill said. “It’s time for us to make some noise. The guys are scrapping together and it’s the mentality we’re taking every day.”

Keller entered with a 1-1 record and 5.06 ERA in three games. He was activated from the injured list Monday after being sidelined since Aug. 2.

After O’Neill got the Cardinals within 4-2, Dylan Carlson hit a sacrifice fly, and Kolten Wong and Tommy Edman delivered back-to-back RBI singles.

The rally took Kwang Hyun Kim off the hook for the loss after he allowed four runs in 51/3 innings. Kim, in his rookie season with the Cardinals after 12 years in the Korea Baseball Organization, had made four consecutive starts in which he pitched at least five innings without allowing an earned run.

“Overall, today wasn’t good for me,” Kim said. “Fortunately, the team won and that’s what really matters.”

Jake Woodford (1-0) retired the last two batters in the sixth and was credited with his first major league win. Genesis Cabrera notched his first save of the season by getting the last five outs.

The Pirates took a 2-0 lead on solo home runs by rookie Ke’Bryan Hayes in the first and Jose Osuna in the third.

Pittsburgh chased Kim during a two-run sixth. Colin Moran hit an RBI single and Jacob Stallings had a sacrifice fly to make it 4-0.

The Pirates fell to 15-37, the worst record in the major leagues.

Manger Derek Shelton said he gave no thought of sending Keller out for the seventh inning.

“Mitch Keller is way too important to the Pittsburgh Pirates,” Shelton said. “He wasn’t getting through nine. For him to go seven innings of a no-hitter? I mean no, it’s not worth it.”

Copyright 2020 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed without permission.