Updated

Washington overcame a pair of one-run deficits in extra innings before Bryce Harper hit the game-winning single in the 12th to lift the Nationals over the New York Mets, 7-6, in the opener of a three-game series on Tuesday.

Harper finished with two RBI, while Ian Desmond knocked in three runs, including the game-tying double prior to Harper's two-out bases-loaded knock in the 12th, in Washington's second win in three games.

"Sometimes it takes some people some time to really learn how to stay calm in those situations. Everyone, obviously, is not going to do it every time, but for the most part, for how young he is, he does a really good job of it," Nationals third baseman Ryan Zimmerman said about Harper.

Ross Detwiler (4-3) earned the win despite allowing the go-ahead home run by Scott Hairston in the top of the 12th.

Elvin Ramirez (0-1) gave up the deciding runs to take the loss for New York, which has dropped its last two games.

The Nationals' first deficit came in the 10th inning after Hairston hit a leadoff single, stole second and advanced to third on a groundout by Andres Torres.

David Wright came up to the plate next and during his at-bat, Henry Rodriguez bounced a breaking ball in the dirt that skipped off the glove of Jesus Flores and went towards the dugout, allowing Hairston to jog home for the go- ahead run.

But the Nationals were able to tie the game in the bottom of the 10th due to a slew of defensive gaffes.

Zimmerman reached first on a fielding error by Jordany Valdespin to start the frame, advanced to second on a grounder to first that Ike Davis could not field cleanly and then went to third on a wild pitch by Bobby Parnell.

After a Michael Morse walk, Desmond hit a hard grounder to short for what could have been a game-ending double play, but Valdespin had the ball carom off the heel of his glove for his second error of the inning, allowing Zimmerman to score the tying run.

Flores reached on an infield single two batters later to load the bases with two outs, but Parnell escaped the jam by fanning Rick Ankiel to end the inning and keep the game alive.

New York went on top again in the 12th when Hairston led off by pulling a hanging 3-2 slider over the left-field wall, but Washington countered with back-to-back doubles by Morse and Desmond to knot the game at six in the bottom of the inning.

Desmond then moved to third with one out on a Ramirez wild pitch before an intentional walk to Flores and Detwiler worked a walk to loaded the bases.

Ramirez seemed as if he would escape the inning after he induced a bouncer to first from Xavier Nady that Davis threw home for the force and then got ahead 0-2 to Harper, but Harper lined the next pitch to left and it fell just in front of a diving Vinny Rottino to bring home the deciding run.

"It feels pretty bad," Hairston said about the loss. "It was one of those games where it was going back-and-forth and we had a couple of unfortunate situations on the field where things didn't go our way, but it's over with and I guess we're just going to have to learn from it and come ready to play tomorrow."

Washington broke the scoreless tie in the third inning on Harper's RBI single and then added to its lead in the fifth inning after a Jordan Zimmermann double and a walk by Steve Lombardozzi placed runners on first and second with one out.

Two batters later, Ryan Zimmerman slapped a base hit up the middle to score Jordan Zimmermann. Lombardozzi was also able to cross the plate on the play on Omar Quintanilla's throwing error to home when he tried to prevent Lombardozzi from scoring while Zimmerman was caught in a rundown between first and second, but threw the ball to the backstop.

New York answered with pinch-hitter Valdespin's leadoff home run to right field and Wright's solo shot to left-center in the sixth to get within 3-2.

Torres' two-run double in the eighth inning gave the Mets their first lead of the game, but Washington quickly answered in the bottom of the eighth on Desmond's run-scoring single to knot the game at four.

Game Notes

Wright's home run was his 736th career run scored, breaking his tie with Jose Reyes to give him the most in team history...Zimmermann started the game for Washington and allowed two runs on five hits with five strikeouts over six innings...Chris Young made his first start since May 1 of last year due to right shoulder surgery and gave up three runs -- two earned -- on six hits and a walk through five innings for New York...Washington has won seven of its last eight games against the Mets.