Denard Span rounds third base and scores on a double by Anthony Rendon in the first inning. (Jonathan Newton/The Washington Post)

It had been 11 days since the Washington Nationals played in their own stadium, long enough for them to coalesce into the team they imagined they would be, and long enough for them to fall into an offensive slump. Summer welcomed them home Tuesday night. Players’ legs started feeling heavy in batting practice, hours before the game started. It was 92 degrees when Tanner Roark fired the first pitch at Nationals Park. The park filled with the kind of sticky, lazy air you need to chew before you can breathe.

The heat provided another reminder that now, in the thick of the season, is no time for a ragged series to turn into a bad week. In their 6-5 victory over the Houston Astros, the Nationals shed the effects of their ruinous weekend sweep in St. Louis, but only after surviving setup reliever Tyler Clippard’s four-run eighth inning.

Once Rafael Soriano converted his 14th save, the Nationals could exhale. They had snapped a four-game losing streak, and they could turn to the standings if they wanted another reason to celebrate. As the Atlanta Braves lost in Philadelphia, the Nationals seized back first place in the National League East, leaping over Atlanta by half a game.

“We struggled a little bit in St. Louis,” third baseman Anthony Rendon said. “We got over that hump and got a couple runs tonight.”

Ryan Zimmerman and Rendon led the Nationals’ nine-hit attack against emerging left-hander Dallas Keuchel and the Astros’ bullpen with two RBI doubles apiece. Roark tied Stephen Strasburg for the team lead in wins with six by limiting damage for five innings, grinding without his best stuff. Craig Stammen and Drew Storen held the Astros at bay into the eighth, before Clippard added unwanted drama.

Rendon’s two-run double off Kyle Farnsworth in the sixth pushed the Nationals ahead, 6-1, a lead seemingly large enough to give Soriano the night off, so long as Clippard produced one more zero, or even an adequate inning.

Clippard entered with a 1.23 ERA, but he had not pitched since Wednesday in San Francisco. Upon Clippard’s entry, the Astros produced a fusillade of line drives.

“They’re an aggressive team,” Manager Matt Williams said. “So they hit a lot of first pitch fastballs.”

Jason Castro, Matt Dominguez and Jonathan Villar all scorched hits, and in an instant the tying run stood in the on-deck circle. After two strikeouts, the threat appeared to subside, but Dexter Fowler blooped another single, and Jose Altuve rocked a two-run double to left field. Suddenly, the Astros trailed by a solitary run.

Williams trudged to the mound to take the ball from Clippard. Aaron Barrett induced a lineout from George Springer, and the Nationals averted disaster.

“It was touch-and-go for a minute,” Williams said.

The last-place Astros are not playing like the sorry outfit that lost 218 games the previous two seasons. Under former Nationals third base coach Bo Porter, Houston had gone 20-12 since May 14 entering Tuesday night, and they sent to the mound one of baseball’s most surprising pitchers.

He may not be a marquee name, but by preventing home runs and minimizing walks, Keuchel has become a likely American League all-star. He entered Tuesday night at 8-3 with a 2.38 ERA, including a 1.33 ERA over his past seven starts. The Astros think he’s the next Mark Buehrle, and some Nationals hitters agreed with the comparison.

Keuchel came in with the highest groundball rate in the majors, masterful at making hitters pound low pitches into the dirt. The Nationals’ game plan: “See the ball up,” Rendon said. Be patient, stay away from the low pitches he wanted them to hit and wait for mistakes at the belt.

The Nationals surpassed their three-run total from the weekend in four innings. Denard Span, stuck in an 0-for-18 slump, started the first with a chopper off the plate that bounced too high for Keuchel to make a play at first. Rendon smoked a double off the right-field fence, and the Nationals had taken a 1-0 lead.

When Zimmerman drilled another double to left-center, it grew to 2-0. He entered the night 7 for his past 46, struggling to find his timing after he missed almost two months on the disabled list.

“When you don’t play for as long as I did, you come back and it’s hard to be consistent,” Zimmerman said. “But now I’ve been playing for a little while, so I’m starting to get back into the groove and not have that soreness from not playing for so long. I’m starting to feel a lot better.”

Zimmerman keyed the Nationals’ next rally, too. With two outs and Jayson Werth on first, Zimmerman roped a liner into the right-center field gap. With an assist from third base coach Bobby Henley’s alert send, Werth scored all the way from first.

Ian Desmond redeemed his strikeout from the first inning, shooting a two-out single to left field. Zimmerman danced around Castro’s tag at the plate, putting the Nationals ahead 4-0.

Coming off three starts in which he allowed three runs in 21 innings, Roark pitched without his best command. The Nationals’ bullpen stirred twice in the first five innings, and he allowed seven hits and two walks. Even as he struggled to control his fastball and Astros clogged the bases, Roark yielded only one run over five innings, lowering his rotation-best ERA to 2.85.

“At the end of the day you gotta grind through and pitch through,” Roark said.

Roark dodged trouble and defused jams. He induced double plays in the first and third innings, the second started with Desmond’s glove-save-stop flourish. He loaded the bases with no outs in the fourth inning, but he yielded only one run, on a one-out, infield single off his foot. He started the escape when Castro struck out swinging at a curveball. To end the inning, he struck out Robbie Grossman swinging at another curveball, this one 74 mph, the pitch he turned to most as his typically pinpoint two-seam fastball faltered.

“Thank God that was there,” Roark said.

The Nationals’ night was scarier than necessary. But it ended with their first victory in nearly a week, and with them back at the top of their division.