The midfielder, who had two years left on his current deal at the Liberty Stadium, has agreed terms that will take him through to June 2019.
Shelvey, who began his career with Charlton Athletic, has made 77 appearances and scored nine goals for the club since arriving from Liverpool in a £5m deal two years ago.
The 23-year-old made 35 appearances in all competitions last season as Swansea enjoyed a record-breaking season, securing an eighth-place finish in the Premier League.
The new contract caps a good year for Shelvey who was told to ‘wise up’ by manager Garry Monk last December after he had collected seven bookings and a red card in the first half of the season.
Shelvey went on to marry former pop star Daisy Evans this summer and he told the club’s website: “The contract been on the cards for a few weeks and I’m glad to get the papers signed so I can now concentrate on my football.
“When my agent mentioned it to me I said ‘when can we get it signed?’ It’s an honour and privilege to sign for another four years at Swansea and give the fans back the support they’ve shown in me.
“The main reason I left Liverpool was to play games. Luckily, I’ve found a club that is a superb place to play your football.
“I feel I’ve got better. I thought I did well in my first year. I didn’t start off too well last season – I had a sticky patch – but at the back end of last season I really kicked on. Hopefully I can get my head down in pre-season and hit the ground running for the start of the Premier League.”