Max Scherzer didn’t allow a Milwaukee base runner until the seventh inning. (Morry Gash/Associated Press)

As soon as the ball broke Carlos Gomez’s bat and floated out to right field, Anthony Rendon raced back. Washington Nationals starter Max Scherzer was perfect to that point, sitting down all 18 batters he had faced. Playing closer to second base because Gomez often hits the ball to the left side, Rendon had more ground to cover. He jumped and stretched for the ball, but it landed inches out of reach.

The blooper to start the seventh inning felt so cheap given the way Scherzer pitched Sunday. The single may have broken up Scherzer’s bid for a perfect game, but it didn’t change the way he dominated. In the Nationals’ 4-0 win over the Milwaukee Brewers, Scherzer was efficient, overpowering and unshakable.

“I got lucky,” Gomez said. “I don’t enjoy it. I would enjoy it if I hit a real base hit. Because he dealt, he pitched unbelievable.”

Scherzer, in his first season with the Nationals, delivered arguably the most dominant pitching performance in team history. The 30-year-old set a Nationals and personal record with 16 strikeouts in a game, topping Stephen Strasburg, who held the mark with 14 punchouts in his major league debut on June 8, 2010. Scherzer, who notched his second career shutout, also became the third Nationals pitcher to notch a one-hit shutout. Jordan Zimmermann and Gio Gonzalez each accomplished the feat in 2013.

“Memorable,” Scherzer said. “To be able to throw a shutout against a major league team, that’s extremely tough to do. I’ve been pitching a long time, and this is No. [2]. I’ve pitched with some really good pitchers, and you don’t see these too often. . . . Sixteen strikeouts means your stuff is on. All the hard work I’ve been putting in, trying to get all my pitches as sharp as possible. I was able to do that. I was able to do that all the way through pitch 120. That’s what I take pride in.”

Scherzer reacts after being doused with chocolate syrup, as is Nationals celebratory custom, by teammate Drew Storen during a postgame interview with MASN’s Dan Kolko. (Morry Gash/Associated Press)

The Nationals sorely needed a win Sunday and another good performance from a starter. They hadn’t won back-to-back games since May 24-25. And entering the game, the Nationals had lost 11 of their previous 15. During that stretch — including Saturday’s terrific performance from rookie starter Joe Ross — Nationals starters had a 5.29 ERA.

But Scherzer “was in command from pitch one,” Manager Matt Williams said.

Scherzer toyed with the Brewers’ lineup, making them look helpless at times. He relied heavily on his two pitches — fastball and slider. He placed his fastball on the edges of the strike zone with ease, got hitters to think about his wicked sliders down and away and then blew another fastball by them.

“The fastball had even more life today,” catcher Jose Lobaton said. “It had a finish as if it was moving up. Batter couldn’t make contact.”

In fact, only two balls left the infield. Of Scherzer’s 119 pitches, he got 27 swings and misses, the most of any starter in the majors so far this season and tying a career high. Against one of the lowest-scoring teams in baseball, Scherzer’s stuff was so good and command so sharp that eight of his 16 strikeouts were on four pitches or less.

“For me to be able to go out there and pitch efficiently and effectively, that’s what this ballclub needed,” Scherzer said.

In the fourth inning, Scherzer dispatched the three hitters he faced on nine pitches. With a 2-2 count, Scherzer dialed back for a high 97-mph fastball to strikeout Ryan Braun. As he walked back to the dugout, Braun mouthed to himself, “Good pitch,” while watching the replay on the Jumbotron. Through six perfect innings and only 67 pitches, Scherzer knew history was in play.

Catcher Jose Lobaton congratulates Scherzer. (Morry Gash/Associated Press)

“I started to pray,” Lobaton said.

“From the sixth inning on, it was pretty tense,” right fielder Clint Robinson added.

To start the seventh inning, Scherzer faced Gomez, who had struck out and popped out weakly in two previous at-bats. Gomez is an aggressive free swinger, like much of the lineup, so Scherzer threw a first-pitch slider down and out of the zone. Gomez thought about swinging but held up. Scherzer then went inside for a swinging strike on a 95-mph fastball. On the third pitch, Scherzer did the same, firing a 96-mph fastball that moved in on him.

“I put some hair on it,” Scherzer said. “I was not letting up on that fastball.”

Gomez, however, managed to keep his hands inside the ball and send it to shallow right field, where it fell in.

“Just couldn’t get it,” Rendon said. “Sucks. You don’t want to be that guy, ‘Oh he could have had it or didn’t have it.’ It’s an amazing accomplishment for [Scherzer].”

Scherzer didn’t flinch. He got another ball and then quickly got a flyout and a popout and struck out Adam Lind. “It takes some luck to throw a no-hitter or perfect game,” Scherzer said.

Playing without their best hitter, Bryce Harper, the banged-up Nationals gave Scherzer all the run support he needed. They took a 1-0 lead in the third on Rendon’s sacrifice fly to right field. An inning later, Lobaton notched an RBI single to make it a 2-0 lead.

Scherzer mowed through the Brewers’ lineup with such ease that he didn’t need much more. But in the seventh inning, the Nationals padded the cushion just in case. After singles by Rendon and Yunel Escobar, Robinson roped a double down the left field line to give the Nationals a 4-0 lead.

Scherzer walked one batter, Scooter Gennett, in the eighth inning but escaped the inning. With his pitch count at 103, Scherzer took the mound for the ninth inning. With a sharp slider that fooled Jason Rogers, Scherzer claimed his 15th strikeout victim. With another five pitches, Scherzer struck out Gomez, the batter who spoiled his bid at history, before ending the game and getting his signature postgame chocolate syrup sprayed on him by Drew Storen.

“I wouldn’t imagine that it’s the last opportunity that he has do something special,” Williams said.