The 21-year-old has put pen to paper on a four-year contract at the Liberty Stadium after agreeing personal terms and passing a medical.
The England international - he has won one cap as a substitute in the 5-0 win over San Marino at Wembley last October - had also attracted the interest of Premier League newcomers Crystal Palace, but their bid was reportedly less than Swansea's.
Shelvey, whose fee also includes a number of potential add-ons, started his career with Charlton before moving to Liverpool for £1.7m in May 2010.
He made 69 appearances for the Reds and scored seven goals, but was deemed surplus to requirements at Anfield by boss Brendan Rodgers as he rebuilds his squad for the new season.
After completing the move, Shelvey wrote on Twitter: "Just wanna say thank you to every one of the Liverpool fans for there support! They were first class. And will be truly missed.
"Will miss the city very much.. And the club! Owe a lot to everyone there! Thank you. Time to start a new chapter in life in Wales. Thank you."
Swansea chairman Huw Jenkins has spoken of the need to increase the quota of homegrown players at the Liberty Stadium and Shelvey fits the bill.
"We have got to make sure that the make-up of our squad is right," said Jenkins.
"And obviously part of that is making sure that we have so many British players in there. We have got to do that - there is no choice because they are the rules."