SCOTTSDALE, Ariz. -- Gabe Kapler did not have to wait long for a second chance to manage again as San Francisco hired Kapler late Tuesday night as their new manager just five weeks after he was fired by the Phillies.

Kapler was long considered to be a favorite for the job due to his connections with Giants president of baseball operations Farhan Zahidi, who was the Dodgers’ general manager when Kapler was their farm director. Zahidi is one of baseball’s most forward-thinking executives and has long been a fan of Kapler.

Kapler was one of the first managers interviewed by the Giants. He replaces Bruce Bochy, who retired at the end of the season after managing the Giants for 13 seasons and winning three World Series titles.

The Phillies fired Kapler after he posted a 161-163 record over two seasons and failed to reach the postseason in either one. He never seemed to win over the Philadelphia fans, either, and general manager Matt Klentak said after the season that Kapler had a hard time gaining acceptance in Philly.

But the fans were not the only ones who failed to climb aboard with Kapler. Owner John Middleton considered firing Kapler in July and spent the final months of the season determining the manager’s fate.

Perhaps San Francisco will be a better fit for the California native.

“I don’t think this is a secret to any of you in this room or anybody watching on TV at home, but I’m a big fan. I think he’s really good at what he does,” Klentak said of Kapler. “Very talented, very hardworking, a good communicator, all the things you’ve heard me say before. And I am very thankful to Kap for what we provided this franchise for the last two years.

"I think, when you look at a lot of the ways we developed culturally, a lot of the growth that we have had both at the major-league level and under the hood that people may not see, I don’t think we make those strides if Kap is not our manager, and I know there are a lot of people in this building that feel the same way I do, a lot of people on our staff, a lot of people in our clubhouse that feel that way. too.”