SAN FRANCISCO -- With a timely swing in the 12th inning, Wil Myers turned his frustrating day into a fantastic one.
Myers hit a three-run homer in the top of the 12th to send the San Diego Padres past the San Francisco Giants 5-2 on Sunday.
His seventh home run and second in two games came on a 1-0 fastball from reliever George Kontos (0-2). Cory Spangenberg singled against Kontos leading off the inning, and Erick Aybar singled two batters later.
Myers was hitless in his five previous at-bats.
"I had some tough pitches. I thought they pitched me very well in my first five, but I felt really good," he said. "I was just looking for that one mistake and I was able to get it in that last at-bat."
Sanchez turned on a 1-1 cut fastball over the heart of the plate for his first home run of the season and third career pinch-hit homer. It was the Padres' first pinch-hit drive in the ninth inning or later to tie a game since Adrian Gonzalez connected against Arizona on Sept. 16, 2009.
Melancon's flop followed a full meltdown by the Giants' bullpen Saturday, when the Padres tagged San Francisco relievers for 11 runs in three innings of a 12-4 win that included Myers' three-run homer.
"I felt really good about the fight to the end," Padres manager Andy Green said.
It was Melancon's second blown save in seven chances.
Ryan Buchter (2-1) pitched two shutout innings for the Padres. Jose Torres worked a scoreless 12th for his first save.
Giants starter Ty Blach pitched seven innings of three-hit ball, retiring 10 of his last 11 batters in his second start for San Francisco since taking injured ace Madison Bumgarner's spot in the rotation. Bumgarner is expected to miss three months with a separated left (pitching) shoulder he sustained in a dirt-bike crash.
Padres starter Clayton Richard gave up two runs in 5 1/3 innings of six-hit ball.
The Padres have won 12 of 16 games against the Giants dating to last season.
San Francisco (9-17) has the National League's worst record and is 39-59 since going into last year's All-Star break 24 games over .500 with the best record in the majors.
"We better start panicking," Melancon said about the Giants' awful April. "If we don't get our act together, it's going to be ugly. There's too many good teams out there ready to go after us. This energy level needs to get going. We need to pick up our play, throw quality strikes. We need to figure it out."
Padres: RHP Jarred Cosart, on the disabled list with a hamstring injury, tentatively plans to pitch for Class A Lake Elsinore on a rehab assignment Tuesday, Green said. Cosart will throw three innings or about 45-50 pitches.
Giants: RHP Neil Ramirez was designated for assignment and the Giants called up RHP Bryan Morris from Triple-A Sacramento. ... CF Denard Span, on the disabled list with a right shoulder injury, tentatively plans to take batting practice in Los Angeles on Monday.
Padres: After an off day, RHP Trevor Cahill (1-2, 4.50 ERA) will pitch the home series opener against Colorado on Tuesday. Cahill is 5-6 with a 4.44 ERA in his career against the Rockies.
Giants: RHP Johnny Cueto (3-1, 5.10) starts the series opener against the Dodgers in Los Angeles on Monday. The two-time All-Star gave up three runs in six innings vs. the Dodgers last week and was 3-1 with a 2.67 ERA against them last season.