Andrew Cashner looked very much like the starter the Padres hope he will become Friday night.

The hard-throwing, 26-year-old right-hander retired the last 12 Giants he faced and gave up only one run on five hits over six innings as the Padres defeated San Francisco – and Tim Lincecum -- 2-1 before 34,921 at Petco Park.

Cashner also ignited the Padres two-run, game-winning rally with a line-drive single off Lincecum leading off the third. Moments later, the 6-foot-6 Texan stole the first base of his career before scoring the tying run.

Cashner, who hit triple digits with his fastball as a relief pitcher last season, topped out at 98 mph Friday night.

One of those 98-mph fastballs, however, struck out Pablo Sandoval with two Giants on and none out in the third and started a run of 19 straight Giants retired by Cashner and the Padres bullpen.

But it was his changeup and the curve that helped Cashner turn back the Giants.

“I was struggling a little bit in the beginning, but I finally settled in and started making pitches,” said Cashner. “I think the last two years have really improved my changeup. Everything is finally coming together.”

“For me, it’s like a really fun toy to play with,” Padres catcher John Baker said of Cashner. “What was really effective for him tonight is he that he got (Hunter) Pence out on three changeups. It comes in like a fastball then falls off the table.

“Whenever we needed a big pitch, he did a great job executing. When he comes out throwing the curve, that’s something they didn’t expect.”

Cashner was projected to be a member of the Padres rotation last winter before he suffered a laceration to a tendon in the thumb of his pitching hand during an early-December hunting accident. The surgery required to fix the wound delayed Cashner’s start to spring training and he opened the season in the bullpen.

After five appearances out of the bullpen, Cashner’s first opportunity to start came last Saturday in San Francisco as a substitute for the ill Clayton Richard – although he has actually replaced the injured Tyson Ross in the rotation.

Cashner lost his first start in San Francisco last Saturday on a two-run homer by Sandoval. In 10 innings against the reigning World Series champions, Cashner has allowed three runs on seven hits and two walks over 10 innings with 10 strikeouts.

After being limited to 65 pitches in his first start, Cashner threw 83 Friday night with 52 going for strikes.

“When he builds his stamina, Cashner’s going to pitch in the seventh inning,” said Padres manager Bud Black. “Tonight was great to see. He’s building. It was another stepping stone. For a guy that throws that hard, he has great feel for his changeup.”

The victory was the second straight – both by 2-1 scores -- for the Padres, who were swept by the Giants in a three-game series last weekend at AT&T Park in San Francisco. Before Friday night, the Giants had won 13 of their last 17 games against the Padres and were 27-12 against the Padres since the start of the 2011 season.

Padres pitchers have allowed only two runs over the last 25 innings.

Down 1-0 in the first, the Padres scored both their runs in the third with the rally triggered by Cashner’s lead-off single to center. After Lincecum retired Everth Cabrera on a foul bunt (thanks to a diving catch by Sandoval) and struck out Will Venable for a second straight time, the Padres chained together three straight line drive singles for a pair of runs.

The first was a shot to right by Chase Headley that forced Cashner to hold at third. Carlos Quentin followed with a line drive single to left to tie the game and Yonder Alonso, who was 1-for-15 against Lincecum going into the at-bat, hit a line drive single to right to drive in Headley with the winning run.

After Cashner struck out Sandoval in the third, he retired Buster Posey and Pence on back-to-back grounders to shortstop Cabrera to keep San Francisco off the scoreboard.

Padres relievers Joe Thatcher, Dale Thayer, Luke Gregerson and Huston Street retired seven more Giants before the run ended with Posey’s one-out single to right off Street in the ninth. The Giants had runners on first and third with two out when Street retired Brandon Crawford on a grounder to rookie second baseman Jedd Gyorko to end the game.

The Giants only run came in the first. Lead-off hitter Angel Pagan greeted Cashner with a single to right, stole second and moved to third on a swinging bunt back to the mound by Marco Scutaro. Pagan then scored on a wild pitch.