Talks over a new deal had appeared to reach an impasse, with the 26-year-old rejecting what was billed as an "exceptional and final offer".
But an agreement has finally been reached to keep Robinson at the club, who rejected bids from Championship sides Cardiff City and Southend Unitd last month.
Chairman Huw Jenkins said: "It was always our intention to try and keep hold of Andy who, in turn, always wanted to commit his future to Swansea.
"He has continued to give this club 110 per cent while the contract talks have been going on, and I'm sure he will continue to drive this football club forward on the pitch.
"Andy is ambitious and wants to play in the Championship. I'm sure we can get there together."