Millar, who joined the club in 2008, admitted that he would not have been happy to sign just a one-year deal with the "precarious" finances of Scottish football.
"I spoke to the club and the two-year contract was the point I wanted to get in there," Sky Sports News quotes Millar as saying. "The club have been good enough to give me that and I'm really happy to be here for another two years.
"When this finishes I'll have been here seven years and in modern football you don't really see that a lot. The club have been good to me and hopefully I've returned some of the faith with what I've done on the pitch.
"It's a difficult time for everybody with the way Scottish football is. It's pretty precarious out there, you don't want to be out of contract and I know there are a lot of boys in that situation. So I'm just delighted that I've got my future sorted."
Millar has made 126 league appearances for Saints.