Said Ian Kroll, who blew his first save opportunity but earned his first Major League win: "It was 10 times better than the last six games. Everybody is amped up. It was kind of emotional going into the bottom of the ninth. But Harp pulled one out for us. That's what he does. That's why we got him on the team. He's unbelievable."
With two outs and Roger Bernadina on first, Harper swung at a 1-1 pitch from Bryan Morris and hit the ball over the left-center-field wall for his 14th home run of the season.
"It's great to get the 'W,'" Harper said. "We really needed it. Going through that AB, I was trying to put something in the gap so Bernie could score."
Washington got off to a great start, scoring four runs in the first inning against right-hander A.J. Burnett, although only one was earned.
After Harper was hit by a pitch, Steve Lombardozzi bunted the ball down the third-base line and beat the throw by Pedro Alvarez for an infield single. Harper got caught in a rundown between second and third, but Alvarez couldn't catch Clint Barmes' throw, allowing Harper to score the game's first run.
Harper finished 3-for-5 with two RBIs and three runs and made an excellent diving catch, while Lombardozzi went 3-for-5 with two doubles, an RBI and two runs and made a spectacular play in the field at second base.
Ryan Zimmerman followed Lombardozzi with an RBI single to right to make it 2-0.
Three batters later, Ian Desmond singled to left to put runners on first and second for Denard Span, who singled to right to score Zimmerman. Desmond also scored on the play, after a throwing error by first baseman Gaby Sanchez.
The Pirates made their third error of the inning when Kurt Suzuki reached first on Jordy Mercer's fielding error, but a run didn't score.
Left-hander Gio Gonzalez started for the Nationals and lasted 5 2/3 innings, allowing three runs on eight hits and four walks, and he matched his season high with 11 strikeouts.
But Gonzalez was the first to say that it didn't feel like he dominated the Pirates.
"It's one of those weird lines," Gonzalez said. "You look at it and find out that at the end I had 11 strikeouts. I kid you not, it felt like I had six. And it felt like the Pirates were putting the ball in play a lot."
Gonzalez allowed a run on Burnett's RBI groundout in the fourth, and then the Pirates made it a game in the sixth. After Sanchez singled, Josh Harrison followed with a two-run homer over the center-field wall to make it 4-3.
"When you have a track record against somebody, even if small, you do kinda go into it with a bit of confidence," said Harrison, whose fifth career homer was his second off Gonzalez. "You already knows what he throws, you've seen everything he has and can take it from there."
Washington added what seemed to be three insurance runs in the eighth off right-hander Vin Mazzaro. Lombardozzi's RBI single scored Bernadina, and then Adam LaRoche hit a two-run triple to make it 7-3.
It appeared the Nationals had put the game out of reach, but the Pirates came back and scored four in the ninth against Rafael Soriano and Krol. Soriano entered the game in a non-save opportunity and looked shaky from the start.
He walked Neil Walker and Starling Marte before allowing an RBI double to Mercer, scoring Walker. After Andrew McCutchen struck out, Russell Martin drove in Marte with a single to left to make it 7-5. Acting Washington manager Randy Knorr, who was filling in for the ejected Davey Johnson, decided to take Soriano out in favor of the left-hander Krol.
"I was watching Soriano pitch when it is not a save opportunity," Knorr said. "He wasn't throwing the ball over the plate. A couple of lefties were coming up, and I like the way Krol throws the ball. I figured if [Soriano] wasn't in that mode to shut the game down, I would bring somebody else in."
Krol had a tough time getting hitters out. The bases were loaded with the Nats one strike away from victory when Harrison singled to center field to drive in two runs and tie the game.
Krol acknowledged he was nervous for the first time since he made his Major League debut on June 5.
"It was crazy to be out there in that situation and something that I'm not comfortable with," Krol said. "It's something I don't normally do. Like I said a million times, you have to go out there and do your job, get batters out, make good pitches and attack the hitters."
By the time the game ended, three hours and 39 minutes after first pitch, both managers -- Johnson and Clint Hurdle -- were not around. Johnson was ejected for arguing balls and strikes in the fifth, while Hurdle was tossed for arguing that Alvarez didn't make the turn at first base after reaching on an infield single in the seventh.
But in the end, the Nationals were happy with the victory.
"People smiling. That lets you know it's a good day," Gonzalez said.