NASHVILLE, Tenn. -- The Chicago Cubs and free-agent infielder Ben Zobrist have agreed to a four-year contract.

The team announced the deal on Tuesday night.

A person familiar with the negotiations says the contract is worth $56 million. The person spoke on condition of anonymity because the terms were not announced.

More from FoxSports

Zobrist, 34, is a switch hitter who plays second, third and the outfield, and he was an important spark for the Kansas City Royals in their run to the World Series title.

With the agreement, the Cubs then traded infielder Starlin Castro to the New York Yankees for right-hander Adam Warren and a player to be named.