Chris Denorfia opened the game with a home run.

Jesus Guzman and Jedd Gyorko each hit a two-run homer in four-run Padres innings.

The Padres totaled 16 hits and Eric Stults picked up a third straight win in a 9-3 rout of the

Giants at AT&T Park as the Padres matched last season’s win total and moved back into sole possession of third place in the National League West.

But the hottest topic Saturday was one at-bat by Padres rookie first baseman Tommy Medica.

With the Padres down 3-1 Medica came to the plate against San Francisco right-hander Yusmeiro Petit after Chase Headley doubled with two out in the fourth.

On the 14th pitch of their duel Medica singled to center to drive home Headley. Guzman followed with a two-run homer to put the Padres head to stay. Three more singles followed as the Padres had a season-high six straight hits to stake Stults to a 5-3 lead.

“Tommy’s was one of the best at-bats of the year” said Padres manager Bud Black who said the inning it triggered was also one of the best of the season.

“This was a good one” said Black. “We’re down to some bench players with a rookie batting. Petit threw all his pitches to all locations with different velocities and Tommy battled him for that hit. That captured the momentum back for us.”

“That was an impressive at-bat” said Guzman who had ring-side seat from the on-deck circle. “Petit threw a lot of good pitches. And Medica fouled them off then went up the middle. It helped me too. I saw a lot of pitches.”

“He kept on making good pitches” said Medica who was raised in the Bay Area and attended Santa Clara University. “I was just looking for something I could get back through the middle.”

The hit was one of a career-high three hits off the bat of Medica as the Padres came within a hit of matching their season-high for a nine-inning game.

“That at-bat gave everyone a boost” said Stults who capped the run of six straight hits with a run-scoring single.

“I like the way we’re playing” said Black as the Padres go into Sunday’s season finale with a 14-8 record over the past 22 games.

Guzman’s homer anchored the four-run fourth that gave the Padres a 5-3 lead. Gyorko’s 22nd homer of the season was the big shot of the four-run ninth.

Both homers carried added significance.

Guzman was a former Giants minor leaguer who never played at AT&T Park until he became a Padre midway through the 2011 season. His homer was his fifth in 92 at-bats at AT&T Park and opened the door to his fourth three-hit game of the season.

Gyorko’s homer moved him into third-place on major league baseball’s all-time list of rookie second basemen.