SAN FRANCISCO — For years, Matt Cain looked like a lock to rocket past the 100-win mark. Over the last couple of seasons, as he battled injuries, Cain had to wonder if it would ever actually happen.

Cain went five strong Sunday and got just enough support, winning his 100th game as a big leaguer and helping the Giants wipe away bad memories from the first five days of this homestand. They beat the Nationals 3-1, salvaging a series split with two weekend wins. 

Cain had one of the strangest starts of his career, a 93-pitch roller coaster that ultimately yielded no hits or runs. He issued five walks in his five innings and lost the strike zone even as he piled up outs. Through four innings, Cain had thrown 40 balls and 39 strikes, but he was keeping the Nationals from rallying. 

The Giants caught a break early when Trea Turner couldn’t handle a double-play ball, allowing a run to score. They benefited from another error in the fifth, but only after an entertaining (and also somewhat desperate) series of moves by Bruce Bochy. 

Madison Bumgarner pinch-hit for Cain and smoked a Gio Gonzalez pitch off the bricks for a leadoff double. Bumgarner was replaced by fellow starter Jeff Samardzija, who didn’t move for two at-bats as actual position players flied out. With two outs, Hunter Pence hit a grounder to third and Anthony Rendon skipped a throw past first, allowing Samardzija to stroll home as AT&T Park shook. 

Bryce Harper led off the sixth with a single and scored on a double, but the Nationals couldn’t push the tying run across. 

Starting pitching report: Cain is the 28th active pitcher to reach 100 wins. Jake Peavy and Johnny Cueto are also on the list, and Bumgarner is five away. 

Bullpen report: Javier Lopez faced one batter. It was Harper. He struck him out. 

At the plate: Bumgarner became the first Giants pitcher to notch a pinch-hit double since Ray Sadecki in 1967. 

In the field: Mac Williamson was injured while trying to make a diving catch in the sixth. He threw across his body to get a force out at third and then stayed down in pain. 

Attendance: The Giants announced a crowd of 41,795 human beings who wondered how Rendon went from second to second on a single to left. 

Up next: A day off! Kind of. The trade deadline is 1 p.m. on Monday. Stay tuned to CSN Bay Area for all your latest Kicking Tires news.