The 23-year-old Brazil international has been subjected to racial abuse on several occasions in Spain
The clubs did not reveal the terms of the contract or financial details, but media reports said the 23-year-old moved for 45 million euros ($50.4 million).
Mario, who scored six goals in 33 league appearances for Sporting last season, played a key role in helping Portugal win Euro 2016.
"We're delighted to have Joao Mario at Inter. He's a top player and we'd been tracking him for a long time. He'll further reinforce what is already a very strong squad," the Italian club's president Erick Thohir said.