Youth is serving the Padres very well of late. Even the offense is helping out.

A night after Odrisamer Despaigne’s dazzling debut, Jesse Hahn outdueled veteran Tim Hudson on Tuesday night, striking out a career-high eight batters after taking a no-hitter into the fifth inning in a 7-2 win over the Giants at AT&T Park.

His ailing back much improved, Chase Headley reached base twice in his return to the lineup, Alexi Amarista drove in three runs on three hits and the Padres mounted their best offensive showing in a month three days after baseball’s worst offense played a pivotal role in General Manager Josh Byrnes’ firing.

Yet, here the Padres are, looking for a sweep of the NL West-leading Giants. They have also moved back to 10 games under .500 after scoring 13 runs in the first two games of the series, their most since scoring 13 against the Cubs on May 23-24, 11 of them coming in one game.

“It had to come at some point; we can’t play bad the whole year,” catcher Yasmani Grandal said. “I’ve been saying it since Day 1. It’s going to happen. I really believed it would happen. … Hopefully we keep on doing the same thing.”

That hope extends to a pair of rookie pitchers breathing fresh life into the rotation.

On Tuesday, Hahn (3-1) added yet another quality start to his run since the Padres recalled him a second time from Double-A San Antonio, scattering two runs on four hits and a walk over six strong innings, four of them perfect right off the bat.

“I felt really relaxed out there; it just feels like an ordinary game now,” said Hahn, who has fashioned a 0.95 ERA over his last three starts. “The first couple starts I still had some nerves and jitters in there. I’ve learned to calm that down a little bit. Now I’m just focused on winning for the team.”

Indeed he is.

In fact, including the seven shutout innings that Despaigne threw at the Giants on Monday, Padres rookie pitchers were working on 24 straight innings without yielding an earned run – 17 from Hahn – when San Francisco scratched something together in the fifth.

To that point, Hahn had retired the first 12 batters he faced, six by strikeout.

“I had good tempo,” Hahn said. “I was getting right back on the rubber and making the next pitch, and I think that helped.”

Then Pablo Sandoval ended any budding no-hitter hopes, as premature as they were, with an infield single that ricocheted off Hahn. The Giant’s hefty third baseman moved to third on Michael Morse’s ensuing single and scored on Tyler Colvin’s groundout.

After a strikeout and a two-out walk, Hahn retired Hudson on groundout to second to escape the fifth with the Padres still leading 3-1.

The Giants adding one more run in the sixth on Buster Posey’s one-out double did little to disrupt Hahn’s night, with the Padres rookie retiring Sandoval and Morse in order to get out of the inning.

Of course, it helped having the Padres score three more runs in the top half of the sixth off Hudson (7-4), two of them scoring on Amarista’s single. In all, the Giants starter allowed six runs – four earned – on nine hits and two walks in 5 2/3 innings.

Meanwhile, three Padres relievers combined for three scoreless innings, Tommy Medica added his first career pinch-hit homer in the eighth and Will Venable even drove in two runs with a pair of productive outs, the sort that eluded the Padres all season as baseball’s worst offense cast a harsh limelight on Byrnes’ job security.

For now, four starts into his big league career, count Hahn among Byrnes’ victories.

Acquired along with the left-handed Torres in the deal that sent Logan Forsythe and four minor leaguers to Tampa Bay, Hahn is taking a giant leap forward as he progresses further and further away from his 2010 Tommy John surgery.

The comeback trail under the Padres began in Double-A San Antonio. With each passing start, it’s becoming clearer and clearer that Hahn will throw the bulk of his approximate 110-inning cap in the majors.

Tuesday’s effort included quite a few more developing change-ups mixed among his career-high 95 pitches, 68 for strikes, as Hahn pushed his punchout total to 27 through four games, the second most to start a career in franchise history behind Bob Shirley’s 28 in 1977.

“I thought tonight the fastball came into play a little bit more,” Padres manager Bud Black said. “I thought good movement to the fastball. Located the fastball in to the righties. Made some good pitches down and away. He had some riding action to cutting action at times.

“I think the fastball resulted in some outs, and again, I think the curve was just like it’s been his previous two. It’s a good pitch. It’s an old-school curveball. It’s a 12-6, top-to-bottom curveball that you don’t see a lot of major league pitchers throw.”