The deal for the 33-year-old Barmes is for two years, and in the $10.5 million range.
''The deal that the Pirates were offering, to guarantee two years at shortstop it was hard to pass up,'' Barmes said.
Barmes spent the first seven seasons of his career playing under current Pirates manager Clint Hurdle in Colorado, helping the Rockies to the 2007 World Series while becoming one of the most dependable defensive shortstops in the game.
The Brewers and Giants also had expressed interest in Barmes, who spent last season with the Astros, batting .244/.312/.386.
Pittsburgh viewed Barmes as the third-best free agent prospect at shortstop behind Jose Reyes and Jimmy Rollins. While they don't have the deep pockets required to go after the perennial All-Stars, they did have enough to give Barmes a deal paying $5 million next year and $5.5 million in 2013, up from the $3,925,000 he made last season.
''In the past we've sat back and waited to see what everyone else picked through,'' Pittsburgh general manager Neal Huntington said. ''You've got to be aggressive and in Clint's case it was guaranteeing the job at shortstop.''
His job will be to provide some clubhouse leadership for one of baseball's youngest teams. The Pirates were in first place in the NL Central in late July before fading to a 70-92 finish, a 13-game improvement over 2010 when they had the worst record in the majors.
Hurdle's presence had a lot to do with the uptick, and Barmes is embracing the next part of what he hopes is a baseball Renaissance in a city starved for a winning product.
''The young talent that they've got and the season they've had last year, there's a lot of promise and a lot of good things to come,'' Barmes said. ''It's only getting better and I'm excited to be a part of it.''
The Pirates earlier this offseason signed free-agent catcher Rod Barajas to a one-year, $4 million deal.
To make room for Barmes on the roster, the Pirates designated catcher Brian Jeroloman for assignment.