The Washington Nationals had a chance Wednesday night to climb further into unfamiliar space. They gave themselves an opportunity to sweep the Atlanta Braves, but then their starter met a sudden end, their rallies unraveled in a blink and they crumbled in the ninth. For one night, they specialized in turning promising situations into undesirable outcomes.

The Nationals ended their series victory over Atlanta with a 5-1 defeat at Nationals Park, pumping a few more breaths into a division competitor on the brink. The Braves would have left town down eight games in the National League East had the Nationals not stranded six base runners in the final four innings, or if Ross Detwiler had not walked the opposing pitcher to spark the Braves’ only rally prior to the final inning.

Instead, the Braves trail by six games after Kris Medlen fired seven scoreless innings. Detwiler dominated for 42 / 3 innings before the Braves finally solved his relentless fastball. He recorded only two more outs, a rapid descent no one could have predicted. The Nationals still took heart in winning the series, but they could have just about knocked the Braves out.

“A win like this kind of rejuvenates us,” Braves third baseman Chipper Jones said. “This win allows us to take a deep breath. . . . We still have our sights set on the division. We’re not just going to concede it to them.”

The Braves, dating from last year, have won 16 consecutive games when Medlen starts. He cruised all game, keeping the Nationals off balance with a constant mix of speeds and pitches. When Washington finally a mounted a rally, he snuffed it immediately. Medlen, who started this year in the bullpen, walked only one and struck out seven as he lowered his ERA to 1.86.

“He’s one of those typical Braves pitchers,” Nationals third baseman Ryan Zimmerman said. “He spots up really good. He mixes his pitches. He’s a really good pitcher.”

The Nationals missed a monstrous chance to score off Medlen in the sixth. They loaded the bases as Jayson Werth hit a leadoff double, then Zimmerman singled and Michael Morse walked with one out. But Medlen scuttled the rally in three pitches. Adam LaRoche popped a first-pitch change-up to foul territory next to first base. Ian Desmond grounded the second pitch he saw to third, and Medlen had escaped.

The Nationals threatened again once Medlen left. In the eighth, Bryce Harper sparked a rally when he rolled a single through the shift to the left side off left-handed reliever Eric O’Flaherty. Harper sprinted to first and, when left fielder Reed Johnson made a slight bobble, he kept on running. He slide headfirst into second, safe. Two batters later, Morse scored him with a single.

After LaRoche walked, Desmond ended the threat with a double-play ball to shortstop. Worse, he seemed to injure his right leg as he tried to beat the throw, hopping the last few steps down the line. But he insisted to a trainer and Manager Davey Johnson he was fine, and he stayed in the game.

Desmond put a scare into everyone — “I forgot about the game when I saw him,” Johnson said. But after trainers checked out his knee, Desmond was certain he would be okay.

“I thought I might have hyperextended my knee a little bit,” Desmond said. “My first reaction was jump off of it before something bad happened. Once I ran down the line, I felt fine.”

Detwiler opened the game with 33 consecutive fastballs, 26 of them strikes. In the first inning, he struck out Jason Heyward swinging through a 96-mph fastball with a man on third and one out. His first breaking ball came on his final pitch of the third inning, when Martin Prado scalded a 1-2 curve back at him. Detwiler snagged the liner, the ninth straight batter he had retired.

Detwiler did not throw another breaking ball until the fifth inning, at which point he was still tearing through the Braves’ lineup. After two quick outs Detwiler needed only to retire Medlen, the pitcher, to post another scoreless inning.

Detwiler met a stunning demise. He had thrown three balls, to only one batter, but against the opposing pitcher he threw four straight.

“I just lost it there,” Detwiler said. “After that, it was all hitters’ counts.”

Rather than move to the sixth with the game still scoreless, Detwiler had to face Prado with two men on base. Prado walked to the plate with 10 hits, five for extra bases, in 18 career at-bats against Detwiler.

Detwiler worked a 2-0 count to 2-2 and tried to finish his nemesis with a fastball. Prado pummeled the pitch to the right of center field. Harper broke in for a couple steps and, as he sprinted to his left, realized the line drive would zip over his head. He raced back, but too late to have a play. The ball skipped off the wall and two runners scooted home.

“I thought I had a good read on it,” Harper said. “He hit it off his back foot with some backspin on it, and he hit it hard.”

Even after the sloppy finish, the Nationals could look forward to rest. They have Thursday off before starting a series Friday in Philadelphia, and then another breather Monday. The Nationals planned a team golf outing for 6 a.m. Thursday at Woodmont Country Club. Davey Johnson, as always, would ask for strokes he did not need.

Late Wednesday, a reporter mentioned to reliever Craig Stammen that the Nationals, after 41 games in 41 days, would have two days off out of five. “You have no idea how good that sounds,” Stammen said.

Standing at the next locker, closer Tyler Clippard overheard half of Stammen’s conversation and wondered what he meant. Stammen informed him about the upcoming days off. Clippard pumped his fist and said, “Yeah!”

The Nationals had faltered in the final game of their most important series yet. But they had still won the series, and anyway, they knew there would more important series to come.

“I don’t think we really look back,” Morse said. “We just keep going, keep pushing.”