MLB

Philadelphia, PA (Sports Network) - Livan Hernandez did it with his arm and his bat on Friday night.

The veteran right-hander stymied the MLB-best Philadelphia Phillies in 6 2/3 innings and helped his own cause by smacking a pair of RBI singles, as the Washington Nationals opened a three-game series at Citizens Bank Park with a 4-2 victory.

Hernandez (7-11) allowed an unearned run on four hits with a walk and three strikeouts.

Rick Ankiel collected two hits and one RBI for the Nationals, who avoided an eighth consecutive loss in Philadelphia.

Hunter Pence and Wilson Valdez both knocked in a run for Philadelphia, which returned home after concluding the best 10-game road trip in club history with a 9-1 record.

Cole Hamels (13-7) gave up three runs on six hits, walked four and fanned five over five frames to absorb the loss.

"We were patient. We made (Hamels) get the ball up," said Washington manager Davey Johnson.

Hamels said he wasn't able to locate his pitches.

"When you're not able to loosen up and get things going, it makes it a little bit tougher," Hamels said. "They found some holes, and that's just kind of the breaks."

Shane Victorino and Chase Utley began the bottom of the ninth with back-to- back singles for the Phillies. After Drew Storen struck out Ryan Howard swinging, Pence lofted a sacrifice fly to right field. But the comeback fell short as Raul Ibanez popped out to second base to end the game. Storen picked up his 31st save of the season.

Washington built a 2-0 lead in the second on RBI singles from Hernandez and Ankiel.

The Phillies got on the board in the bottom of the inning, which started with Howard reaching on a fielding error by Danny Espinosa. A one-out single by Ibanez moved Howard to second and he took third on a flyout before scoring on Valdez's single to center field.

Hamels loaded the bases with no outs in the fifth, but managed to minimize the damage to one run on Jayson Werth's groundout.

Hernandez made it 4-1 with a run-producing single off Philadelphia reliever Kyle Kendrick in the sixth.