Hansbrough played college basketball at North Carolina. He is the sixth new player to join the Hornets this offseason.
"North Carolina has always been a home to me, and I'm excited to come back here and play," Hansbrough said at a news conference Wednesday.
Hansbrough's best season came in 2010-11, when he started a career-high 29 games and averaged 11 points and 5.2 rebounds. However, his playing time and production have steadily decreased since that season. He averaged just 3.6 points and 3.6 rebounds last year.
The Hornets have overhauled their roster this offseason after failing to make the playoffs last season.
Hansbrough will help fill the void left by power forward Bismack Biyombo, whom the team elected not to re-sign this offseason.
Hansbrough was one of the most productive college players ever at North Carolina, the same school that produced Michael Jordan, now the owner of the Hornets.
Hansbrough's arrival in Charlotte comes about a month after the team parted ways with long-time Hornets guard Gerald Henderson, who played at Duke. It was Henderson who bloodied Hansbrough's nose with a hard foul during a UNC-Duke game in 2007.
Information from The Associated Press was used in this report.