Stephen Strasburg gave the Nationals eight sterling innings Saturday night in a 5-2 win over Chicago, improving to 4-3 on the season. (Scott Taetsch/Getty Images)

The bullpen door swung open in the ninth, and Nationals Park cheered. The bullpen cart carried the closer, Sean Doolittle, down the right field line as the echo of cheers of “Doo!” swirled with the chords of Metallica’s “Turn the Page.”

Doolittle retired the Chicago Cubs in order to seal the Nationals’ 5-2 win, though Cubs Manager Joe Maddon finished the game under protest because he said a tap in Doolittle’s motion, which the lefty has used for more than a season, was illegal. Umpires told Doolittle the motion was okay, and after the game, home plate umpire and crew chief Sam Holbrook said, “In our judgment, [Doolittle] did absolutely nothing illegal at all.”

Maddon disagreed.

“There’s no judgment,” he said. “If he taps the ground, it’s an illegal pitch, period.”

Doolittle called it “a thinly veiled attempt to kind of throw me off.” Doolittle added, of Maddon: “In that moment, he’s not trying to do anything but rattle me. It was kind of tired. Sometimes he has to remind people how smart he is and how much he pays attention to the game. . . . He put his stamp on it for sure.”

Before the contentious finish, starter Stephen Strasburg bridged his team to the ninth. The right-hander had bypassed baseball’s worst bullpen in one of his best outings of the year, carrying his team through eight innings, allowing only four hits and one earned run while striking out seven and walking none.

After eight innings, Strasburg was at 93 pitches, his second-lowest pitch count of the season, and it seemed logical to stick with the starter in the ninth. But Manager Dave Martinez knew Strasburg had gone more than 100 pitches in his past four starts. He talked with Strasburg, who he said was “really good with it,” and lifted him for a pinch hitter in the eighth.

“It was hot, and as everybody knows, Stephen sweats a lot,” Martinez said. “He gave us everything he had today. It was awesome. We want to keep him fresh, and he’ll be ready for his next start.”

After the game, a reporter asked Strasburg whether he wanted to stay in for the ninth.

“We got a great closer, so I didn’t want to hold that from him,” he said.

Strasburg was the best version of himself Saturday night, and he delivered the performance the Nationals (19-26) needed. On Saturday, it wasn’t enough simply to pitch well. The team needed him to go long, too.

One night after a spectacular bullpen combustion in a 14-6 loss, it felt as if no lead would be safe for this pitching staff. Martinez had tried every reliever on the active roster aside from his closer, his backup closer and his long man. Each of them allowed multiple runs in Friday’s loss except Joe Ross, who got the one out he needed after allowing a single and hitting a batter.

For their part, the offense tried to render relievers irrelevant. The lineup, which arguably should have scored more Friday night than the six runs it produced, continued to look like a different unit as it nears full health.

In the second inning Saturday, second baseman Brian Dozier capitalized on the long first inning his teammates had made Cubs starter Jon Lester work through when he belted a four-seamer from Lester for his sixth home run. Then a trio of Nationals who had returned from injury in the past two weeks — Trea Turner, Anthony Rendon and Juan Soto — catalyzed a three-run third. By the end of the inning, the Nationals had tagged Lester for a season-high four runs, as many as he had allowed in his past five starts combined.

Soto added an RBI single in the fifth to push the lead to 5-1, knocking out Lester. The cushion was plenty for Strasburg (4-3), who was dealing. All night, the right-hander pounded the strike zone with his fastball sitting around 94 and mixed in his secondary pitches, the curve and the change-up, almost evenly. Then, in the fifth, he hit his first snag.

After collecting two quick outs on groundballs sandwiched around a single, Strasburg allowed a single to Addison Russell, and the battery of Strasburg and catcher Yan Gomes corroded. On consecutive pitches — an 80-mph curveball and a 93-mph four-seamer — Gomes appeared to get crossed up and allowed a passed ball. On the second, high and over the middle of the plate, the ball glanced off Gomes’s glove and went toward the third base line.

Strasburg, frustrated, looked into his own dugout with his arms up and did not cover home plate. The first runner, Jason Heyward, scored. Gomes had chased the ball at first but backpedaled to the plate when he saw Rendon charge to scoop it. Just in time, Rendon threw, Gomes swiped, and they caught Russell — who looked like Superman in the middle of his dive — to save the Nationals a run.

“The more you’ve played the more complex your signs get,” said Strasburg, a 10-year veteran. “It’s hard to differentiate one from the other sometimes. It’s all good.”

The next inning, Strasburg ran a four-seamer inside to Cubs third baseman David Bote, who flicked it over the wall in left field. Unfazed, Strasburg retired his final nine hitters, including his last out of the night in which he got Bote to fly out to right field.

In the final inning, Nationals players felt a familiar uncertainty on the field, but it was only because of Maddon’s two meetings with Holbrook. Doolittle later called it “a compliment” Maddon tried to get in his head that way and said, “I actually have to thank him.” After the second complaint, Doolittle thought he threw three of his best pitches in a while — two fastballs and a slider — to retire the final two Cubs.

This time, at least, that was all the drama Washington needed to face in the ninth.