The 23-year-old came through the ranks at the Portuguese side and made 93 appearances, scoring 14 goals.
Mario has made 18 appearances for Portugal and was part of the Portugal squad who won Euro 2016.
Erick Thohir, Inter Milan's club president is clearly delighted with his club's new signing.
"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," he said.