The hope for a Dodgers comeback in the National League Championship Series ended with the smack of the ball hitting leather.

Milwaukee Brewers left fielder Jackson Chourio, sprinting toward the warning track, had to leap to reel in Kiké Hernández’s line drive in the gap. But he secured the catch. And ended the Dodgers’ season.

The Dodgers’ hopes of making National League history with a three-peat died with a 6-4 loss to the Brewers on Thursday, completing Milwaukee’s four-game sweep.

“It sucked,” veteran left fielder Teoscar Hernández said. “Especially after [what] we had done the last two years. This year at the beginning of the year, what we’ve been through, a lot of injuries throughout the year the last two years, a lot of ups and downs. It just sucked that we’re in this situation, but it’s part of the game.

“Somebody has to win, somebody has to lose. This time, we’re the ones that lost, and just reflect on everything that we didn’t do great this year and just try to do it next year.”

As the Dodgers’ postseason hype video declared before the game: “October doesn’t remember who came close. It remembers who triumphs.”

The Dodgers, after reinforcing to their back-to-back championship roster in the offseason and entering the year as the World Series favorites, fell short. And instead the Brewers will represent the National League, making their first trip to the Fall Classic in 44 years.

“They may have a bunch of Hall of Famers, but we have a bunch of gamers,” Brewers manager Pat Murphy said from the stage. “And the gamers won this week.”

When the Dodgers went down 3-0 in the series, they faced a steep climb that only one team in MLB history has overcome. But the Dodgers showed resolve to begin the game.

Three singles in the second inning gave the Dodgers a lead, with Andy Pages driving in the first run. It was his third hit of the postseason with runners in scoring position and the Dodgers’ fourth overall. Then with two outs, Ohtani not only prolonged the inning but also made it the Dodgers’ highest-scoring frame of the postseason, with their first home run of the series.

It had been a maddening couple of months as Ohtani battled injuries, slid down the batting order and failed to produce when the Dodgers needed him most — in the postseason.

Then on Thursday, with the Dodgers on the brink of elimination, one swing momentarily wiped all that away.

Ohtani got his bat head down to a cutter from former Dodgers pitcher Dustin May on the inside corner. He lifted it into the stands for a three-run home run.

Ohtani turned to the Dodgers’ dugout, spread his arms wide and tossed his bat to the side. He tilted his face to the sky and yelled. He punched the air.

This was the version of Ohtani the Dodgers had sorely been missing. He announced his return with authority. And he breathed life into a stadium that had a crowd of only 49,104 — short of a sellout.

It was his first home run since Aug. 18. And it had been even longer since he’d hit a homer quite like that. With an exit velocity of 113.1 mph, it was his hardest-hit home run since June 20 and his third-hardest hit of the year, according to Statcast.

Even more important, it was the big swing the Dodgers had been waiting for all series.

“It was something that you don’t see very often from Shohei,” manager Dave Roberts said. “I think it was a lot of pent-up anger, frustration. It was the best ball he hit in probably two, three months, and it was a big hit. So I think that for him to look at the dugout, show that emotion, it just shows how much he cares. He’s still human. He still cares and wants to help his team win a baseball game. That was a big hit.”

Dodgers starter Tyler Glasnow kept the good vibes going, retiring the first 10 batters he faced. But the Brewers, as they had all series, had a comeback in them.

“We got a nice lead, we got Glas on the mound, we’re confident behind him,” third baseman Max Muncy said. “And they just kept stringing together one good at-bat after another after another after another. They were just kind of relentless.”

It began with one out in the fourth inning, as Brice Turang drew a walk, the first baserunner against Glasnow. Then William Contreras and Jake Bauers each bounced ground-rule doubles into the stands, Bauers’ driving in two runs to cut the Dodgers’ lead in half.

Dodgers star Shohei Ohtani strikes out with a runner on third during the seventh inning of Game 4 of the NLCS.

Shohei Ohtani strikes out with a runner on third during the seventh inning.

(Gina Ferazzi / Los Angeles Times)

The next inning, the Brewers used a walk, stolen base and David Hamilton’s RBI single to trim the Dodgers’ lead to one and knock Glasnow out of the game.

Right hander Evan Phillips replaced him and loaded the bases the rest of the way, before left-hander Alex Vesia entered to face Bauers, who had been a nightmare for the Dodgers this series.

Vesia walked Bauers on four pitches, tying the score at 4-4.

The Dodgers had lost their momentum, but they still had time.

Then, in the sixth, Dodgers setup man Tanner Scott took the mound early, at an inflection point in the contest. He worked ahead 0-and-2 in the count to Garrett Mitchell. But Mitchell spat on three straight balls to get to a full count.

Scott missed down the middle with a fastball. Mitchell sent it over the fence to give the Brewers the lead for the first time.

Even down by a run, Roberts continued to manage like he had hope, bringing in Edwin Díaz in the seventh to keep the game close.

The Dodgers’ offense got runners to third in three straight innings. In the sixth, Kyle Tucker hit a one-out double, and Teoscar Hernández moved him over with a groundout. In the seventh, Pages led off with a double, and Kiké Hernández bunted him over. In the eighth, with one out, Will Smith cut out the middle man by doubling into the right-field corner and advancing to third when Milwaukee’s Sal Frelick misplayed the carom off the wall.

The Dodgers stranded all three at third, failing to score the tying run.

“They just outplayed us this series,” first baseman Freddie Freeman said. “That’s just kind of how it goes. We had our opportunities. We just didn’t get it done.”

Díaz did his part to keep the Dodgers in the game, retiring eight straight batters. But the ninth batter he faced, Hamilton, hit a solo homer to add cushion to the Brewers’ lead.

“I wouldn’t want to go through this with any other group of guys,” Muncy said. “We really tried to do something special in this clubhouse, and I know next year we’ll be ready to get right back to it. But right now, this sucks.”