ESPN.com's Jayson Stark reports that the contract will pay Hamels $4.35 million this year, $6.65 million in 2010 and $9.5 million in 2011.
If Hamels wins the Cy Young Award, his base salary would increase by $500,000 the following season. If he places second or third in the Cy Young voting, the contract would increase by $250,000 in the following season.
It's the largest average annual value ever on a multiyear contract for a starting pitcher in his first year of salary arbitration.
"We're very pleased with the fact that Cole has had an opportunity to be rewarded for his accomplishments in the past,'' Hamels' agent, John Boggs, told ESPN.com's Jerry Crasnick. "The contract gives Cole a degree of financial security, and it didn't compromise his last year of arbitration or touch any free-agent years, which was our goal.''
With his new deal, Hamels avoids a salary-arbitration hearing in February. The Phillies still face a potential arbitration hearing with first baseman Ryan Howard, who made $10 million last year and finished second to Albert Pujols in the National League MVP voting.
In his third season, Hamels helped lead the Phillies to their second World Series championship, going 14-10 with a 3.09 ERA in the regular season.
Hamels said Sunday he wants to experience another championship in Philadelphia.
"If I'm able to go out there and repeat, I think it's just going to make it a really nice, sweet time for this baseball city," Hamels said.
Hamels, 25, has a 38-23 record with the Phillies. He's 4-1 with a 2.16 ERA in six career postseason starts.
He went 4-0 in the 2008 postseason with a 1.80 ERA, which included the clinching Game 5 in the World Series, in which he scattered five hits and two earned runs over six innings in a 4-3 victory over the Tampa Bay Rays.
Hamels was a first-round pick in 2002. He made his major league debut in 2006 and led the team with 15 wins in his first full season in 2007.
"It just goes to show you how much Cole's improved the last three years and what the organization thinks of him," said Phillies manager Charlie Manuel. "From a manager's standpoint, it makes me feel real good to know we've got him for three more years."
Information from ESPN.com's Jayson Stark and Jerry Crasnick and The Associated Press was used in this report.