Casillas, who will be 38 in May, said on Wednesday: "It's not easy to count on someone who's almost 38-years-old. I'm grateful for the confidence shown in me and hope to finish my career at a club where I feel at home."
Since arriving from Real Madrid in 2015, Casillas has made 149 appearances for Porto. He was a key member of the squad that helped Porto win its first title in five years.
During his 16 years at Real Madrid, he won 18 trophies including five La Liga championships and three Champions League crowns.
He was also skipper of the Spain squad that won Euro 2008, the 2010 World Cup and Euro 2012.