SAN FRANCISCO — Ryan Braun lashed Tim Linecum’s breaking ball down the third-base line. The right-hander turned quickly, and saw exactly what he expected.

Pablo Sandoval had gotten a great jump and easily gloved the ball as he stepped into foul territory. He planted his feet and fired a perfect strike to first, beating Braun by inches. Lincecum pointed his glove at Sandoval, as he has done so often this season.

“You kind of feel like the play is always going to be made,” Lincecum said.

That’s a new feeling for the Giants pitching staff. A year ago, Sandoval was such a defensive liability that he completed just 97 of the 137 games he started at third base. This season the eye test and advanced metrics confirm the same thing: Sandoval is one of baseball’s best defenders at the hot corner. During a maddeningly inconsistent season for the Giants, Sandoval’s glove has been golden from the team’s hot April through a disappointing road trip that concluded Sunday.

The timing of this defensive breakthrough couldn’t be better for Sandoval, a 28-year-old who will be a free agent at the end of the year and could command a deal worth nine figures. The contract push hasn’t been characterized by increased homers or a higher average, but by a renewed dedication to defense.

What’s been the main difference when Sandoval takes his position?

“Everything is different,” he said, smiling.

Sandoval then hit on what has always been the key to his production, or lack thereof.

“I lost weight,” Sandoval said. “I feel great out there. It’s all the hard work I did during the offseason and spring training. I worked hard on the first step and getting in the right position to catch balls that I couldn’t reach before.”

Sandoval ate his way past the 280-pound mark last season, but checked in at 250 this spring. He has put on some padding over 118 games, but the Giants are comfortable with his current condition. The weight loss has led to a quickness gain that’s evident nightly.

“He came into spring training in the best shape he’s been in since 2011, and put in the work,” manager Bruce Bochy said. “His range is increased. He has always had good hands, but he has gotten so much better at the backhand play and coming in on slow rollers. The first-step quickness, that’s always huge and one of (the keys) was to get the weight off.

“He had to increase his first step quickness, which he has done.”

Sandoval stands out using traditional methods, too. He hasn’t committed an error in 65 games and leads Major League third baseman with a .980 fielding percentage.

“For a bigger dude, he’s pretty nimble over there,” Lincecum said. “He makes the hard plays and also makes the easy plays, and kind of everything in between. Regardless, he always does it in Pablo fashion.”

That means with a smile on his face. It was there even in April and May, as Sandoval struggled at the plate. Sandoval was hitting just .173 through May 10, with two homers and 12 RBIs. For most hitters in a contract year, this would cause further pressing at the plate. Sandoval simply shifted his goals.

“I knew I wasn’t contributing as a hitter, so I tried to focus a little bit more on working on defense, saving runs and making the play for whoever was on the mound at that moment,” Sandoval said. “I focused on the little things. I knew the hitting was going to come.”

Sandoval is batting .330 since that low point, with 12 homers, 15 doubles and 49 RBIs.

The hot stretch has helped keep the Giants in the race despite massive power outages up and down the rest of the lineup, and it could put Sandoval on a few MVP ballots, something that was impossible to imagine in early May. He ranks 15th among N.L. hitters in wins above replacement (3.4), per FanGraphs. Baseball-reference.com rates Sandoval even higher at 4.1 WAR, putting him seventh among N.L. position players.

The slumping Giants will take every big hit they can get these days and are pleased to see that Sandoval’s glove work hasn’t tailed off any as his bat has warmed up.