Updated

Jerry Hairston Jr. hit a two-run double with two outs in the sixth inning to chase Florida ace Josh Johnson, and the San Diego Padres beat the Marlins 5-4 Sunday to avoid a three-game sweep.

Newly acquired Ryan Ludwick came up big during the three-run rally, delivering a pinch-hit single and sliding in ahead of the throw after Hairston doubled over left fielder Logan Morrison's head.

The NL West-leading Padres kept San Francisco from creeping any closer. The Padres entered the day with a 1½-game lead over the Giants, who played the Los Angeles Dodgers on Sunday night.

San Diego right-hander Jon Garland (10-7) outpitched Johnson (10-4), allowing three runs and five hits in six innings with six strikeouts and three walks. Johnson gave up seven hits and a season-high five runs in 5 2-3 innings. He struck out five and walked four.

Johnson's major league-leading ERA rose from 1.72 to 1.96. It was the first time in 20 starts he didn't pitch at least six innings.

Heath Bell allowed Morrison's RBI single with two outs in the ninth before retiring Gaby Sanchez with runners on first and third for his 30th save in 33 chances.

Trailing 3-2, the Padres loaded the bases with one out in the sixth on a single by Yorvit Torrealba, a walk to Will Venable and, after Scott Hairston popped up to Johnson while bunting, a single to left by Ludwick, the former All-Star who came over from St. Louis in a three-team trade Saturday.

Chris Denorfia hit a sacrifice fly to tie the game and Hairston put the Padres ahead.

The Padres wanted to be cautious with Ludwick because of a recent calf injury, so they kept him out of the starting lineup. Ludwick, though, showed no ill effects as he raced from first to home. The relay throw got to catcher Ronny Paulino just before Ludwick got to the plate, but by the time Paulino turned to apply the tag, Ludwick came sliding in and touched the plate with his left hand.

Torrealba had three hits and extended his hitting streak to 14 games. He hit a two-run double in the first, but the lead didn't last long. Paulino's two-out single in the second brought in Cody Ross, who singled and went to third on Garland's error on a pickoff attempt.

Hanley Ramirez tied it with a leadoff homer in the third, the Marlins' fifth homer this series. Ramirez's shot, which reached the second deck in left, was his 14th.

The Marlins went ahead 3-2 on Wes Helms' two-out single in the sixth.

NOTES: Miguel Tejada is 1 for 10 with two walks and a run scored in three games with the Padres. ... It was the second straight start Johnson allowed three earned runs or more. He had not allowed more than two earned runs in any of his previous 13 starts. ... Left-handed reliever Will Ohman made his Marlins debut with one-third of an inning in relief of Johnson. Ohman reported a day after being obtained from Baltimore in exchange for RHP Rick VandenHurk. ... Padres manager Bud Black originally said Ludwick would play RF and bat cleanup, but Ludwick said the team wanted to be cautious because he recently spent time on the disabled list with a calf injury. ... To make room for Ludwick, San Diego placed INF Oscar Salazar on the 15-day disabled list with a strained right Achilles' tendon.