SAN DIEGO — Tim Lincecum pitched his first career no-hitter and the second in the majors in 11 days, a gem saved by a spectacular diving catch by right fielder Hunter Pence in the Giants’ 9-0 win over the last-place Padres on Saturday night.

The two-time Cy Young Award winner in a season-long funk was the loser when Cincinnati’s Homer Bailey no-hit the Giants on July 2, threw a whopping 148 pitches.

Lincecum (5-9) was in control from the start Saturday, striking out 13. He walked four and hit a batter.

Still, he needed some help to preserve his no-no. Pence caught Alexi Amarista’s sinking liner with a full dive to end the eighth. The Freak pumped his fist as Pence jumped up with the ball in his glove. Amarista put his hands to his helmet and pulled it off in disgust.

“I thought for sure it was a hit,” Lincecum said. “You see Hunter flying out of nowhere making the flying grab. That was really impressive a big play for us.”

Pablo Sandoval did his part, too, when he made a nice backhanded play on pinch-hitter Jesus Guzman’s grounder deep behind third base and threw him out for the third out of the seventh.

Lincecum had been struggling coming in, losing his previous four decisions and hadn’t won since June 4 against Toronto. He hadn’t won on the road since April 3 at the Los Angeles Dodgers.

Then again, he had gotten just 12 runs of support in his last 10 starts.