The 31-year-old Slovenian international, who has been with Inter since joining from Udinese in 2012, had been due to become a free agent this summer, with his previous contract having just six months left to run.
"When both parties want to extend then there are never any problems," Handanovic said in response to the news.
Handanovic was linked with a number of Premier League sides over the last few months, including Manchester United when David de Gea's future was far from certain. He was also described in a Daily Mail column in June as "Slovenia's only truly world class player".
The imposing stopper has been an ever present in Serie A so far this, playing every minute of all 17 games as Inter lead the table at the winter break. The Nerazzurri also have the best defence in the country, with Handanovic conceding just 11 times in the league so far.
Inter will resume their 2015/16 season, looking for a first scudetto since 2009/10 when Jose Mourinho's team completed a treble, when they face Empoli away from home on Wednesday.
The club from Tuscany are currently 8th in Serie A after an impressive run of four straight victories before Christmas. Manager Roberto Mancini said at his media conference on Tuesday, "We need to produce a great performance. Empoli are going well and it will be a tough match."