Hudson threw seven strong innings Thursday, leading the Giants to a 7-1 win over the Washington Nationals in the finale of a four-game series.
The Giants salvaged the last game of the series after losing the first three while scoring five total runs.
The Nationals were looking for the franchise's first four-game sweep in San Francisco since turning the trick as the Montreal Expos from July 13-15, 1975, but managed just six hits against Hudson (7-2) and seven overall.
Hudson allowed one unearned run, struck out five and walked two while lowering his ERA to 1.81 -- 0.04 points better than Cincinnati ace Johnny Cueto.
Hunter Pence and Michael Morse had three hits apiece for the NL West-leading Giants, who had lost the first three games of the series after sweeping the Mets in a three-game set to open their 10-game homestand. They haven't lost four in a row this season.
The Nationals had a four-game winning streak snapped, falling to 8-2 in their last 10.
Rookie right-hander Blake Treinen (0-3) remained winless in eight major league appearances. The 25-year-old gave up two runs on five hits and three walks in five innings in his fourth start.
Tyler Colvin tripled in the second inning to score Morse, who had led off with a single, and Colvin then scored on Brandon Crawford's groundout to give the Giants a 2-0 lead.
Adam LaRoche's two-out single in the fourth inning was Washington's second hit of the game. He went to second on a passed ball and scored when Ryan Zimmerman slapped a single into right field, getting the Nationals within 2-1.
But the Giants tacked on two runs in the sixth inning for a 4-1 lead. Pablo Sandoval and Morse hit consecutive singles off Craig Stammen to start the inning and Sandoval scored on a balk. Morse came home later on Gregor Blanco's base hit.
Pence singled and scored on Sandoval's sacrifice fly in the seventh and Hector Sanchez added a two-run single in the eighth for the final margin.