SAN FRANCISCO – After saving the go-ahead run from scoring with an incredible diving play in the 11th inning, Brandon Crawford booted a routine grounder with two outs and a runner on third in the 16th, allowing the New York Mets to beat the Giants 4-3 in the longest game of San Francisco’s season.

Tim Lincecum struck out 11 in a start that seemed like ancient history by the time the final out was recorded at 12:42 a.m..

The Giants are now 6-7 in extra innings games, 25-18 at AT&T Park and, at 40-48, a season-high eight games under .500.

Starting pitching report Through four innings, Tim Lincecum looked like the two-time Cy Young Award winner of yore.

He opened the first frame with back-to-back strikeouts and needed just 21 pitches to make it through two perfect innings. After punching out John Buck to open the third, Lincecum walked Omar Quintanilla on four pitches to give the Mets their first baserunner. But he bounced back by striking out his opposite number Matt Harvey and getting a routine ground ball to short from Eric Young. Lincecum breezed through the fourth inning using just 11 pitches and recorded his fifth and sixth strikeouts of the evening.

Lincecum ran into his first real trouble in the fifth, as Marlon Byrd broke up the no-hit bid with a clean single to left that snuck through the hole between Pablo Sandoval and Brandon Crawford. After another strikeout, Buck sent a ball past Gregor Blanco in center for an RBI double, but was stranded at second when Lincecum caught Quintanilla looking at a high changeup and got Harvey to ground out to a diving Pablo Sandoval at third.

Heading into the game, Lincecum averaged more runs allowed in the sixth (0.82) than any other inning this season. The Mets got to him for two more Monday.

Leadoff man Young sent a ball down the leftfield line that Andres Torres failed to cut off, letting it rattle around in the corner while Young flew around the bases for a triple. The next batter, Daniel Murphy, sent a shallow fly ball to left to put Torres to the test again. Unfortunately for the Giants, the Torres from 2010 that was so solid defensively appears to be long gone. Murphy’s bloop hit off the heel of Torres’ glove as he was sliding in to score Young and tie the game.

Murphy moved up to third when David Wright hit a single that never left the infield. Sandoval dove to glove Wright’s hard-hit grounder, but threw to second, where he had no chance to catch Murphy. Marco Scutaro caught Sandoval’s late throw and made matters worse when he threw wide of Brandon Belt at first for a throwing error. The Mets made the most of the mistake when Ike Davis hit into a 4-6-3 double play that plated Murphy and gave the Mets a 3-2 lead.

Lincecum erased another mistake by a Giants outfielder, a mistimed dive from Gregor Blanco on a shallow fly ball to center for a triple, by notching his ninth strikeout of the night.

Two more strikeouts in the seventh gave Lincecum 11 total for his first double-digit total of the season and 33rd of his career.

Lincecum’s final line: 7 IP, 6 H, 3 ER, BB, 11 K. He lowered his ERA from 4.66 to 4.61, threw 70 of his 102 pitches for strikes and did not factor into the decision, leaving him at 4-9 on the season.

Bullpen report Jeremy Affeldt was the first to relieve Lincecum and turned in 1.1 scoreless innings. He walked Wright with two outs in the eighth, but erased the mistake by picking him off. He recorded one out in the ninth before giving way to Sergio Romo, fresh off taking the loss Sunday against the Dodgers.

Romo got the last two outs of the ninth with a strikeout and a fly ball to shallow right that Pence had to dive to catch. The Giants’ closer stuck around to get the first out of the 10th, a ground ball to short, before Bruce Bochy turned to Jose Mijares. The large left-hander struck out Quintanilla and got a 4-3 groundout from pinch-hitter Andrew Brown.

Sandy Rosario got two quick outs to open the 11th inning, but walked Wright and got himself into real trouble when the Mets’ All-Star third baseman advanced to third on a hit-and-run single by Ike Davis. Wright was on his way home to score the go-ahead run when Marlon Byrd hit a sharp ground ball into the hole between third and short, but Brandon Crawford made an unbelievable backhanded play on a dive and beat Byrd by a step with a strong throw to first for the third out.

Rookie Jake Dunning gave Bochy two scoreless innings, lowering his ERA from 1.59 to 1.35 in the process.

George Kontos got the call to start the 14th and induced three straight grounders. He worked a 1-2-3 15th as well, but gave up a one-out single to Young in the 16th. A stolen base and groundout moved Young to third and led Bochy to call on his last available arm out of the bullpen, left-hander Javier Lopez. Lopez got the ground ball he needed from pinch-hitter Anthony Recker, but Crawford made a rare misplay, allowing Young to score the go-ahead run.

At the plateBochy’s new 3-4 duo of Brandon Belt and Buster Posey nearly hit back-to-back home runs off Mets phenom Matt Harvey in the first inning. After Marco Scutaro’s one-out single, Belt sent a ball to the wall just to the left of the ‘399’ marker in dead centerfield that ended up in Kirk Niewenhuis’ glove for out No. 2. But Posey picked Belt up by squaring up a 95 MPH Harvey fastball in a 3-1 count. Posey’s towering shot easily cleared the wall for his 13th home run of the season, tying Hunter Pence for the team lead.

After the first inning, the Giants’ bats went quiet against the devastating combination of Harvey’s heat and off-speed pitches, particularly the slider.

From the second through the sixth, Harvey allowed just a single, double and walk.

Hunter Pence led off the seventh with an opposite field shot that bounced high off the wall above Triple’s Alley. Bruce Bochy came out of the dugout to argue that the ball left the field of play and should’ve been a home run, but the umpiring crew went to replays and determined that the correct call was made. But Pence didn’t stay at third long as Crawford followed with a comebacker past a ducking Harvey and into centerfield for a game-tying single.

The Giants mustered just a single against the Mets’ bullpen from the eighth through the 10th innings, but started a rally off former Giants first-round pick David Aardsma in the 11th. With one out, Buster Posey lifted a fly ball to shallow right that fell between two Mets and was surprisingly ruled a double, Posey’s fourth hit of the night, instead of an error. The Mets intentionally walked Sandoval to get to Pence, who lined out sharply to right, before switching right-handers, from Aardsma to Greg Burke. Burke got Crawford to chase the first pitch for an easy pop-up to end the threat.

The Giants were just 2-for-16 against the Mets’ bullpen when Gregor Blanco hit a two-out single in the 12th. Scutaro made it a bona fide rally when he followed with another single, but Belt struck out, his fourth of the game, to send the game to the 13th inning. He would finish 0-for-8 with five strikeouts.

Cole Gillespie got a shot with the bases loaded after Sandoval hit a one-out single, Crawford moved him up to third with a two-out double and Andres Torres was intentionally walked. Gillespie’s grounder to short left the bases loaded and sent the game to the 14th, officially the longest game of the Giants’ season.

Sandoval led off the bottom of the 15th by taking a pitch off his foot and moved up to second on George Kontos’ first career sacrifice bunt. A fielder’s choice sandwiched by two walks loaded the bases for Blanco, but he grounded out to first, leading to boos from the restless crowd.

Scutaro led off the bottom of the 16th with a walk off Mets closer Bobby Parnell and, after another Belt strikeout, advanced to second when Posey lined a single up the middle. Sandoval chased a pitch out of the zone to strike out, putting the pressure on pinch-hitter Guillermo Guiroz, Bochy’s last available option off the bench. Quiroz grounded into a fielder’s choice to end the game at five hours and 26 minutes.

The Giants left 18 on base and finished 1-for-15 with runners in scoring position.

In the field Pablo Sandoval dove to his left to knock down a ground ball off the bat of Matt Harvey and collected himself in time to throw a strike across the diamond to catch the slow-footed pitcher, stranding the game-tying run at second base in the fifth.

Brandon Crawford avoided a lumbering Panda to make an impressive backhand catch on a pop up to shallow left in the ninth inning.

Pence laid out to rob Nieuwenhuis of a hit off Romo in the ninth, sliding toward second base on the grass as he held his glove up for second base umpire Todd Tichenor to confirm the catch.

Crawford made perhaps the defensive play of the Giants’ season when he saved the go-ahead run from scoring in the 11th with a diving backhand stop, robbing Marlon Byrd of a hit.

Sandoval made another incredible play in the 12th, when he jumped to grab Quintanilla’s screaming liner and doubled off Nieuwenhuis off first base to end the inning.

Gillespie made a diving catch sprinting toward the infield to end the top half of the 15th inning.

Attendance The Giants announced a crowd of 41,497 for their 208th consecutive regular season sellout.

Up next The Giants and Mets play the second of three games in the penultimate series before the All-Star Break Tuesday at 7:15 p.m.. New York will send RHP Dillon Gee (6-7, 4.45 ERA) to the mound to oppose LHP Barry Zito (4-6, 4.44 ERA).