The 26-year-old defender had been linked with a move away from the Liberty Stadium but has finally agreed a deal after recent negotiations.
"I am delighted to have signed the new deal and pledged my future to Swansea," the Welsh international told Sky Sports News.
"I am happy to have everything resolved and now we can focus the games ahead. These are exciting times for the club and I am happy to be involved."
The Swans begin their debut Premier League season on Monday night with an away trip to Manchester City.