Bryce Harper barely remembered the end but he felt it. The details remained hazy — the ball bouncing around the red seats his raised fist as he rounded first base the mix of joy and relief that engulfed Nationals Park. All he knew was his body throbbed in the spot Ryan Zimmerman kept jabbing after his leap into a pile of waiting exuberant teammates. “He was punching me in the frickin’ rib” Harper said smiling.

The celebration had come after Harper rescued the Washington Nationals turning what could have been their most demoralizing loss yet into a 9-7 Band-Aid victory over the Pittsburgh Pirates. Their manager got ejected their closer imploded and their season teetered until the moment with two outs in the ninth inning Thursday afternoon when Harper blasted his first career walk-off home run.

They snapped their six-game losing streak only after the Pirates tied the game with four runs in the ninth inning a meltdown that included bench coach Randy Knorr’s bold yanking of $28 million closer Rafael Soriano for 22-year-old rookie Ian Krol as Manager Davey Johnson watched from the clubhouse exiled after his first ejection of the season.

“Just walking into the clubhouse right now you’d think we won the World Series or something” Knorr said.

They won for the first time in 11 days after Gio Gonzalez had let one four-run lead shrink and Soriano had allowed another to disappear. They salvaged an offensive breakout that included Steve Lombardozzi’s 3-for-5 two-double sparkplug spot start. The timing and nature of the victory mattered far more to Harper than the way he crushed Bryan Morris’s hanging 1-1 slider over the left-center field wall.

“I’m serious I couldn’t care less about whether it went over the fence or if it was a double off the wall” Harper said. “I don’t really remember any of the play. I kind of do. But I’m just very happy that we won the ballgame.”

The Nationals’ deficit in the National League East stood at eight games and they still have work ahead to undo the damage from the first week of the second half. Harper’s walk-off though had at least given them somewhere to start a burden lifted.

“If we had lost today I think that would have been kind of a dagger for us” said reliever Tyler Clippard who pitched a scoreless eighth inning. “But we fought back. Today we turned it around which is huge for our confidence and our morale.”

The Nationals seized a 4-0 lead in the first inning using Lombardozzi’s bunt single as a catalyst and capitalizing on three Pittsburgh errors. Gonzalez would match a career high with 11 strikeouts but he also walked four and needed 119 pitches to pitch 52 / 3innings. Josh Harrison’s two-run homer in the fifth made it 4-3.

“You find out at the end you had 11 strikeouts” Gonzalez said. “I kid you not it felt like I only had six.”

The Nationals loaded the bases with no outs in the fifth which led to Johnson’s ouster. Jayson Werth and Ian Desmond both struck out looking at fastballs off the outside corner. As Desmond fumed Johnson screamed in home plate umpire Mike Winters’s face. Winters tossed him immediately. As Johnson walked to the showers he ceded control to Knorr.