Ruiz, an All-Star catcher in 2012, hit .268 with five homers and 37 RBIs in 92 games last season after serving a 25-game suspension for using a banned amphetamine. He also spent time on the disabled list.
"Numerous times we've stated Carlos' importance to our ballclub," general manager Ruben Amaro Jr. said. "Not only does he combine excellent defense with offensive production, but the last couple years he has developed into a clubhouse leader and someone who is relied upon, not just by the pitchers he works with but by young position players, as well. Carlos is a championship-caliber player at a premium position and we are very happy to have him as a Phillie for 2014 and beyond."
The sides agreed to terms Monday in a deal that takes Ruiz off the free-agent market. Ruiz, who turns 35 in January, has spent his entire career with the Phillies. He played a key role in helping them win five straight NL East titles from 2007-11 and the 2008 World Series title.
Ruiz, who earned $5 million last season, will make $8.5 million in each of the next three years. Philadelphia holds a $4.5 million club option for 2017 with a $500,000 buyout.
Known for his defensive skills, Ruiz has improved his hitting over the past four seasons. He's batted .295 since 2010, third-best among NL catchers during that span.
Ruiz set career highs with a .325 average, 32 doubles, 16 home runs and 68 RBIs in 114 games in 2012.
"Certainly this is a commitment that will be scrutinized," Amaro said of the length of the deal.
Ruiz is a .274 career hitter with 57 homers and 336 RBIs in eight seasons. Mostly used as the No. 8 hitter in the lineup during Philadelphia's title run, Ruiz often batted in the middle of the order the last two seasons.