NEW YORK — Ruben Tejada scored the winning run on a throwing error by catcher Buster Posey and the New York Mets beat the San Francisco Giants 5-4 Saturday after blowing a three-run lead moments earlier in one of the wackiest ninth innings imaginable.

Mike Pelfrey tossed eight terrific innings, and it appeared the Mets were headed to a fairly simple victory. They were leading 4-2 with two outs in the top of the ninth when Jon Rauch came out of the bullpen and got pinch-hitter Brandon Belt to hit a high popup to shallow center.

Tejada had trouble with it immediately, though, fighting to get under the ball behind shortstop as it swirled around in the wind. Rookie center fielder Kirk Nieuwenhuis came rushing in and overran the ball, which dropped behind him for a two-run double.