Hamilton is coming off an AL MVP season in which he hit 32 homers and had 100 RBIs to go along with a .359 batting average.
He gets a $3 million signing bonus, a $7.25 million salary this year and $13.75 million in 2012.
Hamilton made $3.25 million last season, when the Rangers went to the World Series for the first time in franchise history. When the sides exchange proposed arbitration salaries last month, Hamilton had asked for $12 million, $3.3 million more than Texas had offered. But after more discussions, they were able to bridge the gap before a hearing scheduled for Tuesday.
The three-time All-Star has a .311 career average with 93 homers and 331 RBIs in 468 major league games, an incredible comeback for the former No. 1 overall draft pick whose career was derailed by well-documented cocaine and alcohol addictions after he got hurt in the minors. He made his major league debut with Cincinnati in 2007, and he flourished after being traded to Texas.
"We want to be a part of this organization, not only for the next couple of years, but for a long time to come," Hamilton said.
General manager Jon Daniels termed the talks with Hamilton as "very good negotiations" and said he hopes the deal is indicative of a "longer relationship" that will include another multiyear agreement in the future.
"It was apparent that both sides wanted to do something to recognize both Josh's importance to the club, but also he and his family's desire to be here for an extended period of time," Daniels said. "I think the first step that we took here with this deal kind of gets through the arbitration process."
It has been 11 years since the Rangers went to an arbitration hearing with a player.
"Obviously you want to have things behind you as far as the business standpoint, before you go start playing again," Hamilton said. "This deal done allows me to do that for a couple of years now. ... Just go play and have fun, and stay away from walls."
The new deal doesn't have to keep the two sides from talking about a longer-term deal, but it does mean they aren't under any pressure right now to do it.
Hamilton, who turns 30 in May, said earlier this week that he's gained back the 10 pounds that he lost during a bout with pneumonia in January. Hamilton spent six days in the hospital receiving treatment, but said he feels better and is working out in preparation for spring training.
Hamilton said he weighs 233 pounds but would like to gain five to seven more pounds.
"The reason I'd like to be heavier is you obviously lose weight when you play here in the summer months," Hamilton said Monday.
Rangers pitchers and catchers report to Surprise, Ariz., next Wednesday. The first full-squad workout is Feb. 20.
Richard Durrett covers the Rangers for ESPNDallas.com. Information from The Associated Press was used in this report.