MIAMI (AP) -- A 59-foot curveball in the seventh inning ended Tim Lincecum's winning streak Sunday. A fat splitter early in the game gnawed at him more.
Lincecum gave up a two-run homer in the first inning to Casey McGehee, which helped the Miami Marlins beat the San Francisco Giants 3-2.
"My split ball didn't split," Lincecum said. "It just kind of hung. It stinks because it was an 0-2 pitch. That's the hardest part about today, knowing that I should have been in the driver's seat on that pitch, and I gave him a cookie."
Lincecum's other mistake was a curve that bounced for a wild pitch to score a runner from third, putting the Marlins ahead to stay as they snapped a six-game losing streak and averted a three-game series sweep.
Lincecum (9-6) allowed three runs in seven innings, ending his streak of wins in four consecutive starts.
"It's a very tough way to lose a ballgame," Giants manager Bruce Bochy said. "Timmy threw great."
Brad Hand (1-2) earned his first victory as a starter since 2011, pitching seven innings to match a career high and allowing two runs. The left-hander had been 1-12 previously as a starter.
With the score 2-all, Adeiny Hechavarria doubled to start Miami's seventh, took third on a sacrifice and came home when Lincecum misfired a curve to Reid Johnson, and the ball caromed away from catcher Hector Sanchez.
"I was just trying to get him to chase and be aggressive in that situation," Lincecum said. "I didn't do that, and the ball squirted away."
McGehee came in leading the NL with 118 hits, but the two-run homer in the first inning was only his second this year.
"It's a little weird," the Marlins' cleanup hitter said. "I would have thought maybe I would have run into a couple more. But it doesn't bother me too much, and until the guys give me a hard time about it, I don't really think about it."
Hunter Pence had two hits for his 36th multi-hit game, most in the majors. But he Giants' offense, which has sputtered for much of July, suffered a relapse after three consecutive robust games. Their final 12 batters went down in order.
Buster Posey drove in their runs with a double in the third.
Giants second baseman Marco Scutaro singled in the third for his first hit of the season. He was sidelined for the first 3 1/2 months because of a strained lower back and had sat out the past three games because of a stiff neck.
"I'm not too much concerned about production right now," Scutaro said. "Obviously I want to win and everything, but the main thing is feeling good and being able to compete. Today was a good day. At least I felt better than the last game I played. One step at a time and we'll see what happens."
NOTES: Giants 1B Brandon Belt will go on either the seven-day or 15-day DL because of a concussion, Bochy said. Belt was struck by a ball in the face while fielding during batting practice Saturday. ... RHP Ryan Vogelsong (5-7, 3.86) is scheduled to pitch for the Giants when they open a four-game series Monday at Philadelphia against LHP Cliff Lee (4-4, 3.18).