The contract will pay Hampton a base salary of about $2 million plus incentives, a source said.
FOX 26 Sports in Houston first reported the deal.
Astros general manager Ed Wade declined comment to The Associated Press. Hampton's agent, Mark Rodgers, did not return a phone message left at his office.
Hampton, 36, has a 141-105 record in 14 seasons with the Seattle Mariners, Astros, New York Mets, Colorado Rockies and Atlanta Braves. He's been limited to only 25 starts since 2004 because of injury problems
The Braves and St. Louis Cardinals had also expressed interest in Hampton, who joined reliever Jeremy Affeldt as the second free agent to switch teams in what has been a slow offseason.
Hampton pitched for the Astros from 1994-99, winning 15 games in 1997 and 22 in 1999. He then was traded to the Mets and left New York after the 2000 season to sign a $121 million, eight-year contract with Colorado. It proved to be one on the worst free-agent signings ever, with Hampton going 56-52 with a 4.81 in just 147 starts for the Rockies and Braves, who acquired him after the 2002 season.
Hampton missed the 2006 season recovering from elbow surgery and opened the 2007 season on the disabled list with a left oblique injury. He then learned he had a torn flexor tendon in his left elbow, leading to another season-ending surgery.
Hampton was 13-9 with a 4.28 ERA with Atlanta in 2004, his last full season. He went 3-4 with a 4.85 ERA in 13 starts in 2008, including the season finale in Houston.
Since Hampton has spent so much time on the disabled list over the past two seasons, he did not qualify as a Type A or B free agent in the Elias Sports Bureau's rankings. Houston will not have to surrender any draft pick compensation to Atlanta as part of the signing.
Jerry Crasnick covers baseball for ESPN Insider. Information from ESPN.com's Jayson Stark and The Associated Press contributed to this report.