The right-back will leave Manchester City when his current contract expires at the end of next month and officially join the Hammers on July 1.
Zabaleta has agreed a two-year deal at London Stadium and is Slaven Bilic’s first major signing of the summer.
“Sometimes a new challenge is all you need as a person and as a player,” Zabaleta told West Ham’s official website. “I thought my time at City was done. It’s been a fantastic nine years, absolutely brilliant.
“Manchester City gave me the opportunity to come to this wonderful league, the Premier League, something I’ve been enjoying a lot as a player and of course for me it was probably the right time to move on.
“Also, as a player, I thought I wanted to keep playing in the Premier League. For me, after being in this country for so long, this is a new challenge for me in the Premier League and I’m ready for it and looking forward to it.”
Sky Sports News HQ revealed in April that West Ham were interested in bringing Zabaleta to the club, with Bilic looking to add “game changers” to his side in order to push for the top six next season.