Second baseman Joe Panik, released by the San Francisco Giants on Tuesday, has agreed to a free-agent deal with the New York Mets, the team announced Friday.
It's a homecoming for Panik, who attended high school in Hopewell Junction, New York, and attended St. John's University. He cleared waivers on Friday.
The Mets, who enter Friday's game against the Washington Nationals just a half-game out of the second National League wild-card spot, need a second baseman after Robinson Cano tore his left hamstring earlier this week.
Panik hit .235 with three homers and 27 RBIs in 103 games for the Giants this season. In 643 career games with San Francisco, he hit .271 with 36 homers and 221 RBIs.
He became the odd man out in San Francisco when the Giants acquired Scooter Gennett from the Cincinnati Reds at the trade deadline.
In a corresponding move, the Mets designated infielder Adeiny Hechavarria for assignment. Hechavarria had hit .204 with five home runs and 18 RBIs in 60 games this season.
Cano, 36, is hitting .252 with 10 homers and 32 RBIs in his first season with the Mets after being acquired from Seattle. Infielder Luis Guillorme, who was called up from Triple-A Syracuse when Cano was placed on the injured list Monday, has been starting at second base this week.
A rookie in 2014, Panik played a large role that postseason as the Giants beat the Kansas City Royals for their third World Series championship in five seasons. In Game 7, Panik started a key double play when he dove to snare an Eric Hosmer grounder, then flipped the ball with his glove to shortstop Brandon Crawford, who threw to first.
Panik also had a clutch two-run homer off Adam Wainwright as the Giants beat the St. Louis Cardinals in Game 5 of the National League Championship Series to reach the World Series.