Ross Detwiler (1-2), one of six Washington pitchers, tossed a scoreless ninth to earn the victory. Philadelphia's season-best, five-game winning streak was snapped.
The Nationals also found out on Saturday that right-hander Jordan Zimmermann, who had Tommy John surgery in August 2009, doesn't have structural damage to his throwing shoulder or elbow now.
Zimmermann abruptly left Friday's start in the fourth inning due to arm pain. However, an MRI revealed a biceps strain that likely won't cost him a start.
"That's a big relief for us," Nationals manager Matt Williams said.
Zimmermann was slated to participate in his second straight All-Star Game on Tuesday, but he won't make the trip to Minneapolis. He was replaced on the NL roster by Marlins right-hander Henderson Alvarez.
"I feel pretty good today," Zimmermann said. "I expect it to get better every day."
His teammates were feeling good, as well, after gutting out an extra-inning win over Philadelphia.
"Huge win coming back with a day game (Sunday) right before the All-Star break," Ryan Zimmerman said.
Rafael Soriano struck out the side in the 10th for his 22nd save.
Washington's Stephen Strasburg struck out nine in 5 2/3 innings and was in line for the victory before Ben Revere's RBI single with two outs in the eighth tied it 3-3.
Marlon Byrd had two hits and two RBIs, and Revere had a pair of hits for the Phillies.
The Nationals went ahead in the 10th against Jake Diekman (3-3).
"I thought we had a play," Utley said. "It didn't work out in our favor. It was a big play. I tried to get it to him quickly. It didn't work."
Diekman struck out Adam LaRoche before Zimmerman singled to center to score Span and give the Nationals a 4-3 lead.
"He's been clutch his whole career," Strasburg said.
Werth went to third on Revere's throw and scored on a wild pitch.
Diekman was ejected by home-plate umpire Andy Fletcher following the inning.
"I asked, `Were any of those close?'" Diekman said. "With a smirk on his face, he said, `What pitches?' With a grin on his face, he told me I was kicked out of the game. That's literally what I said."
Strasburg gave up two runs and seven hits in a matchup of aces with Philadelphia's Cole Hamels.
"He made pitches when he had to," Williams said.
Hamels surrendered three runs and four hits, striking out five and walking three, in seven strong innings. It was the 11th time in 13 starts the left-hander has gone at least seven innings, but he continued to be a victim of lack of run support.
The Phillies offense averaged 6.2 runs during their winning streak but managed just two for Hamels.
The Nationals got on the board in the first when Span scored on Werth's groundout. Ian Desmond, who returned to the lineup after missing Friday's game with a right thumb injury, led off the second with a double.
Hamels then retired 12 of the next 13 batters before walking Rendon to lead off the sixth. Werth followed with an opposite-field homer, his 11th, to put Washington in front 3-0.
The Phillies couldn't muster much offense against Strasburg until the sixth.
After walking Grady Sizemore to lead off the third, Strasburg retired the next nine batters before Jimmy Rollins' leadoff single in the sixth. Utley followed with a single to put runners on first and second. After an out, the Phillies executed a double-steal, moving runners to second and third. Both scored on Byrd's single to left that pulled Philadelphia within 3-2.
Jerry Blevins relieved Strasburg and got Revere to line out to left.
Revere came up big for the Phillies in the eighth when he singled home the tying run with two outs off Tyler Clippard.
Nationals C Wilson Ramos went 0-for-4 to end his 14-game hitting streak. ... Washington's Scott Hairston started in place of Bryce Harper in left. Hairston entered batting .395 (15-for-38) with five homers against Hamels and went 1-for-3 against the lefty. ... The teams complete their series on Sunday when Washington RHP Tanner Roark (7-6, 3.12) opposes Phillies RHP Kyle Kendrick (4-8, 4.46).