Ki joined Swansea for £5.5 million from Celtic in 2012 but his future at the club looked in serious doubt after he was sent on loan to Sunderland for the 2013-14 season.
But the South Korea international is back in favour under new manager Garry Monk and scored in his side's surprise 2-1 win at Manchester United on the opening day of the season.
He has played the full 90 minutes in both of Swansea's Premier League fixtures this term - they followed up their victory at Old Trafford by beating Burnley - and said he was excited after committing his future to the Welsh outfit.
"I'm very pleased," Ki told the club's official website.
"This is what I have wanted to do - my first option was always to renew with Swansea.
"I am very pleased with all of the players and staff at the club, so I am very happy to sign a new contract.
"I want to sacrifice myself for the team and, as always, do as much as I can to help this team improve.
"I will be giving 100 per cent, and I am looking forward to continuing my work with the club."
Ki also said that the arrival of Monk had significantly changed things at Swansea and that he expects the club to improve dramatically this season.
"There are a lot of differences in just one year," he added.
"I needed to grow as a player and I have more confidence since returning. This year I want to show much I have grown.
"We work very hard in training. I know the manager very well and he knows me. He knows my strengths and weaknesses and I can learn from him.
"He wants us to be very organised and disciplined. I like the way he manages, so I think we will improve a lot under him.
"This team has a great potential, and I am sure that we will be amazing as time goes by.
"In my first season [at Swansea], we finished ninth. But this year, I think we can go further. I want to make sure we improve."
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.