MILWAUKEE -- The way Max Scherzer was pitching, the Milwaukee Brewers were going to need a bit of luck to get anyone on base.

They got it -- barely.

Scherzer struck out a Nationals-record 16 and threw a one-hitter, losing his perfect-game bid on Carlos Gomez's broken-bat, bloop single in the seventh inning as Washington beat the Brewers 4-0 Sunday.

"I was able to execute every pitch for the most part where I wanted to," Scherzer said.

Gomez opened the seventh with a looper to shallow right field that just fell inches beyond the outstretched glove of second baseman Anthony Rendon. Gomez said he "got lucky" to get that hit off Scherzer.

"I wouldn't imagine that that's going to be the last opportunity that he's going to have to do something special," Nationals manager Matt Williams said.

Scherzer watched the ball drop then turned away.

"Why would I be disappointed on a broken-bat base hit? It takes luck to do that," Scherzer said.

Scherzer set a career high for strikeouts and broke the Nationals mark of 14 set by Stephen Strasburg in his big league debut in 2010. The franchise record of 18 was set by Bill Gullickson in 1980 with Montreal; the Expos moved to Washington for the 2005 season.

Scherzer (7-5) walked one and finished the day with a 1.93 ERA.

He was still throwing fastballs in the mid-90s in the eighth inning. Scherzer's off-speed stuff kept hitters off-balance.

"Every at-bat you stand at the plate, you see him ... throwing a pitch consistently, throwing the ball where the catcher wanted the ball, pounding the strike zone down," Gomez said. "And he got that change and the slider all day long."

Scherzer, in the first season of a seven-year, $210 million contract, threw his second complete game in his 211th start of his career, which includes a Cy Young Award, two All-Star selections and a lot of strikeouts.

His other complete game was a three-hit shutout on June 12, 2014, for the Detroit Tigers against the Chicago White Sox.

The Brewers rarely hit the ball out of the infield. When they did, the 30-year-old righty mainly held hitters to harmless popouts.

Scherzer also hit a single in the fourth. Going into the seventh, he had reached base more than the Brewers.

Scooter Gennett worked a full-count walk with one out in the eighth, about the closest that Scherzer came to showing any semblance of struggling.

Scherzer came back to strike out Hector Gomez and Martin Maldonado swinging, the second whiff coming on a 96 mph fastball.

The Nationals scored two runs off rookie Taylor Jungmann (1-1), who labored through five innings in his second career start. Clint Robinson added a two-run double with two outs in the seventh off Jeremy Jeffress.

Jungmann allowed seven hits, walked two and struck out five. He liked his breaking ball but felt he didn't have command of his fastball.

Manager Craig Counsell said Jungmann has earned another turn in place of injured starter Wily Peralta.

"Hopefully, the next outing, I can put together the fastball and the breaking ball and go from there. We'll see what happens," Jungmann said.

Washington salvaged a split of a four-game series with last-place Milwaukee even with slugger Bryce Harper watching from the dugout. He got the day off after being hit by a fastball on his left leg in Saturday's 7-2 win over the Brewers.

"He's still sore. Good that we were able to get him a day off today and get some treatment on it. We'll see how he is tomorrow," Williams said.

TRAINER'S ROOM

Nationals: 2B Danny Espinosa stayed in the game after appearing to hurt his right foot on a slide while being thrown out by catcher Maldonado trying to steal second to end the top of the third.

Brewers: Veterans 3B Aramis Ramirez and C Jonathan Lucroy got regular days off from the starting lineup.

UP NEXT

Nationals: Washington opens a home-and-home series against the Rays with two games at Tampa Bay. LHP Gio Gonzalez (4-3) won his only career start against the Rays while with Washington, a 5-2 win at Nationals Park on June 21, 2012.

Brewers: Kyle Lohse (3-7) takes the mound for the start of a home-and-home, four-game series against Kansas City. The right-hander last won when the Brewers beat the Mets 7-0 on May 15, going winless in his next five starts.