ST. LOUIS (AP) Rookie outfielder Tommy Pham will never forget his first major league hit.
Or his first stolen base and run scored.
Pham scampered home with the go-ahead run on a sacrifice fly by Jhonny Peralta in the eighth inning, and the St. Louis Cardinals beat the San Diego Padres 2-1 Saturday to stop their longest losing streak of the season at four games.
Recalled on Friday from Triple-A Memphis, Pham had a trio of personal firsts in his second career start.
''This is a special (day). I will always remember it,'' he said. ''It means a whole lot, just to be up here and contributing.''
Carlos Martinez threw 6 2-3 solid innings, and Seth Maness (3-0) got the win. Trevor Rosenthal closed for his 24th save in 25 opportunities, getting Matt Kemp to ground out with a runner on to end it.
Rosenthal had a 23-game scoreless string halted on Friday.
San Diego won the first two games of the series, including a 2-1 victory Friday. All four losses during St. Louis' skid came at home.
Pham reached on an error by shortstop Alexi Amarista to start the eighth. Pham stole second on the first pitch and went to third on a sacrifice by Matt Carpenter.
Peralta then hit a two-strike fly to right to bring in the tiebreaking run. Pham barely beat the throw from Will Venable with a headfirst slide, hooking his hand on the plate.
''We were waiting for somebody to do something and he did it,'' Peralta said. ''I felt it was deep enough when I hit the ball. He's a pretty good runner.''
St. Louis manager Mike Matheny inserted Pham into the leadoff spot hoping he could kick-start a slumping offense that had managed just six runs in its previous four games. Pham scored both runs.
''We put him in a tough spot to see how he was going to respond,'' Matheny said. ''It was nice to see that first hit. In the eighth, he comes out of the box hard and that put pressure on the defense.
''He was good. He was just what we needed today.''
Brandon Maurer (5-1) took the loss.
The Cardinals improved to 52-28 overall and 30-11 at home, both marks the best in the majors. They have won seven times this season by a score of 2-1
Martinez allowed eight hits and one run. He struck out five and walked two.
''I felt really good. I competed,'' said Martinez, who was looking for his 10th win.
Martinez gave up a fourth-inning homer to Yangervis Solarte, then shut the door.
''I said after that, that's the only run I'm going to give up,'' Martinez said.
The Cardinals are still struggling on offense, although Matheny sees good things ahead.
''It's a matter of time until we start putting up the big offensive numbers that we know we can,'' he said.
San Diego starter Odrisamer Despaigne gave up one run and four hits in five-plus innings.
''I just tried to be aggressive and have a good approach to the hitters,'' Despaigne said through a translator. ''Today, it was working.
St. Louis tied the game in the sixth on a double by Pham and a run-scoring single by Carpenter.
The Padres were looking for their first three-game winning streak since June 2-5.
''This is a tough loss when you've got a little momentum going,'' manager Pat Murphy said. ''(Despaigne) was great, the relief corps was great. It comes down to a tough error.''
Padres C Derek Norris was in the lineup despite spraining his left shoulder Friday. Norris collided with Cardinals 1B Xavier Scruggs while beating out an infield hit. Norris has started 67 of 83 games behind the plate.
St. Louis RHP Lance Lynn (5-4, 2.74 ERA) will face RHP Ian Kennedy (4-7, 4.86) in the finale of the four-game series Sunday. The Cardinals have scored just 32 runs in 13 of Lynn's 14 starts. Kennedy has allowed one earned run in each of his last four starts.