Mesa joins from Las Palmas, where he spent seven seasons and helped the club win promotion to La Liga in 2015.
The 28-year-old made 35 appearances last season - scoring once - as Las Palmas finished 14th in La Liga.
Mesa is manager Paul Clement's third summer signing following Dutch goalkeeper Erwin Mulder and Tammy Abraham on loan from Chelsea.
Spaniard Mesa becomes the third most expensive signing in Swansea's history after Borja Baston (£15.5m) and Wilfried Bony (£12m).
His pass-completion rate of 91.4 per cent was the fourth highest in La Liga last season and Swansea boss Clement knew of Mesa's ability from his time working as Carlo Ancelotti's assistant at Real Madrid between 2013 and 2015.
"I'm very happy to be here. It's a new challenge and a new adventure," Mesa told the official Swansea website.
"The manager knows me, he knows how I play and what I can contribute to the team. I'll try to make the team play.
"I know he's like Ancelotti - he likes to play and wants to create a different Premier League team which likes to play."
Swansea are also interested in signing Welsh winger George Thomas from Coventry City.
Thomas, 20, impressed for Wales Under-20s at the Toulon Tournament in June.
The winger scored nine goals in all competitions for Coventry last season but could not prevent them being relegated from League One.
Thomas is out of contract with the Sky Blues, but Swansea would have to pay compensation because he is under 24.
Swansea face competition for Thomas' signature from fellow Premier League clubs Leicester City and Newcastle United, while Scottish side Rangers have also been linked with Thomas.
Meanwhile, Swansea's opening home game of the season at the Liberty Stadium against Manchester United has been moved forward to a 12:30 BST kick-off on Saturday, 19 August.
The home fixture against newly-promoted Newcastle United has been moved to the Sunday, with the game now taking place on 10 September, with a 16:00 BST kick-off.
Swansea's away game against Tottenham Hotspur at Wembley Stadium on Saturday, 16 September has been moved from 15:00 to a later 17:30 BST kick-off.
Find all the latest football transfers on our dedicated page.
Swansea City have completed the signing of Spanish midfielder Roque Mesa for £11m on a four-year deal.