The contract also contains a vesting option for a fourth year worth $11 million, the source said.
With completion of the deal, Rollins will stay with the organization that has been his baseball home since 1996, when the Phillies selected him in the second round of the amateur draft.
"Gotta deal with me for 3 (4) more years!" Rollins wrote on Twitter. He also thanked former Philadelphia Eagles safety Brian Dawkins, who tweeted congratulations to Rollins and the Phillies.
Rollins, 33, is a three-time All-Star, three-time Gold Glove winner and won the National League MVP award in 2007. He is fourth on the Phillies' career list behind Richie Ashburn, Mike Schmidt and Ed Delahanty with 1,866 hits, and ranks among the franchise's top five in games played, plate appearances, runs, total bases, doubles, triples and stolen bases.
Rollins joins Jose Reyes (Miami), Rafael Furcal (St. Louis), Clint Barmes (Pittsburgh) and Jamey Carroll (Minnesota) as the fifth starting shortstop to sign a multiyear deal as a free agent this winter.
Although Rollins had expressed interest in signing a five-year deal upon entering the free-agent market, the contract could still keep him with the Phillies through the 2015 season, when he will be nearly 37.
Rollins will be reunited in Philadelphia this season with fellow Oakland, Calif., native and close friend Dontrelle Willis, who signed a one-year deal with the club Thursday.
Jerry Crasnick is a senior baseball writer for ESPN.com.